1
是否有类似于Sequential Attribute
的东西,我可以将其放在课程本身上。 并且在类级别上使用顺序变量,而不是在特定的测试级别上,因为它与Sequential Attribute
一起使用。班级级别nunit的顺序属性
我只需要运行与我们使用的变量组合相关的TestFixtureSetUp。
感谢
是否有类似于Sequential Attribute
的东西,我可以将其放在课程本身上。 并且在类级别上使用顺序变量,而不是在特定的测试级别上,因为它与Sequential Attribute
一起使用。班级级别nunit的顺序属性
我只需要运行与我们使用的变量组合相关的TestFixtureSetUp。
感谢
如何Parameterized Test Fixtures?您可以在您的TestFixture c'tor中传递参数列表,例如:
[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());
}
}