Are there any tools in the xUnit.net infrastructure that are similar to the following NUnit features?
[Test, TestCaseSource("CurrencySamples")] public void Format_Currency(decimal value, string expected){} static object[][] CurrencySamples = new object[][] { new object[]{ 0m, "0,00"}, new object[]{ 0.0004m, "0,00"}, new object[]{ 5m, "5,00"}, new object[]{ 5.1m, "5,10"}, new object[]{ 5.12m, "5,12"}, new object[]{ 5.1234m, "5,12"}, new object[]{ 5.1250m, "5,13"},
This will lead to the creation of 8 separate tests in the NUnit GUI
[TestCase((string)null, Result = "1")] [TestCase("", Result = "1")] [TestCase(" ", Result = "1")] [TestCase("1", Result = "2")] [TestCase(" 1 ", Result = "2")] public string IncrementDocNumber(string lastNum) { return "some"; }
This will generate 5 separate tests and automatically compare the results ( Assert.Equal() ).
[Test] public void StateTest( [Values(1, 10)] int input, [Values(State.Initial, State.Rejected, State.Stopped)] DocumentType docType ){}
This will give 6 combinatorial tests. Priceless.
A few years ago, I tried xUnit and loved it, but it lacked these features. Can not live without them. Something has changed?