mardi 26 mai 2015

xUnit error messages in the Visual Studio Runner

I am using xUnit theory to group related input to the same test, such as this:

[Theory]
[InlineData("fg00123 kj 56", "123")]
[InlineData("123", "123")]
public void NormalizeString(string input, string expectedOutput) {
    Assert.Equal(expectedOutput, MethodToTest(input));
}

But if the first fails I can only see the expectedOutput and actual output. I realize that I can change the expectedOutput to something unique, but it is not unreasonable to test several inputs that all give the same output. Is there no way to display in visual studios testrunner what input caused the test to fail?

Aucun commentaire:

Enregistrer un commentaire