Last active
January 29, 2021 13:59
-
-
Save jonesandy/070cab55861622d3156a08f4e957899f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Xunit.Sdk; | |
public class MyTestDataAttribute : DataAttribute | |
{ | |
// Auto-implemented member | |
public override IEnumerable<object[]> GetData(MethodInfo testMethod) | |
{ | |
// Create returned object arrays | |
yield return new object[]{ someData, someData, someData }; | |
yield return new object[]{ someData, someData, someData }; | |
} | |
} | |
public class TestClass | |
{ | |
[Theory] | |
[MyTestDataAttribute] | |
public void Test(param one, param two, param three) | |
{ | |
// Test things | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment