Sequential Attribute on a class level nunit
Is there something similar to Sequential Attribute
that I can put on the class itself.
And use the Sequential variables on the class level and not on a specific test level as it works with Se开发者_StackOverflow社区quential Attribute
.
I just have to run TestFixtureSetUp related to the combination of the variables we are using .
Thanks
How about Parameterized Test Fixtures? You could pass the list of parameters in your TestFixture c'tor, e.g:
[TestFixture("hello", "hello", "goodbye")]
[TestFixture("zip", "zip")]
[TestFixture(42, 42, 99)]
public class ParameterizedTestFixture
{
private string eq1;
private string eq2;
private string neq;
public ParameterizedTestFixture(string eq1, string eq2, string neq)
{
this.eq1 = eq1;
this.eq2 = eq2;
this.neq = neq;
}
[Test]
public void TestEquality()
{
Assert.AreEqual(eq1, eq2);
if (eq1 != null && eq2 != null)
Assert.AreEqual(eq1.GetHashCode(), eq2.GetHashCode());
}
}
精彩评论