By default nunit tests run alphabetically. Does anyone know of any way to set the execution order? Does an attribute exist for this?
If you are using [TestCase], the argument TestName provides a name for the test.
If not specified, a name is generated based on the method name and the arguments provided.
You can control the order of test execution as given below:
[Test]
[TestCase("value1", TestName = "ExpressionTest_1")]
[TestCase("value2", TestName = "ExpressionTest_2")]
[TestCase("value3", TestName = "ExpressionTest_3")]
public void ExpressionTest(string v)
{
//do your stuff
}
Here i used the method name "ExpressionTest" suffix with a number.
You can use any names ordered alphabetical see TestCase Attribute