mardi 27 octobre 2015

Extra test run when using InlineAutoData without using InlineAutoData

I have the challenge that when using InlineAutoData that the test is run with random values as well. The background is that I am testing a conversion with some input that is required to follow the specification. I am not interested in random data.

The following test runs twice. Once with the InlineAutoData and one with random strings. The test have been deliberately made simple and to fail on the random data run:

[Theory, GeneralTransferTestConventions]
[InlineAutoData("Allowed", "Allowed")]
public void Testing(string test1Data, string test2Data)
{
    Assert.Equal(test1Data, test2Data);
}

My question is if there is a way to avoid the test run with random data and how to do that?

Aucun commentaire:

Enregistrer un commentaire