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 }; |
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
/* | |
STRINGS | |
*/ | |
Assert.Equal(expectedString, actualString); | |
Assert.StartsWith(expectedString, stringToCheck); | |
Assert.EndsWith(expectedString, stringToCheck); | |
// Some can also take optional params | |
Assert.Equal(expectedString, actualString, ignoreCase: true); | |
Assert.StartsWith(expectedString, stringToCheck, StringComparison.OrdinalIgnoreCase); |