B_Fixture
…
N_Fixture
Bad_Fixture
B_Fixture
B_Child_Fixture
[TestFixture]
public class A_Fixture
{
[Test]
public void Success()
{ }
}
public class Bad_Fixture
{
[Test]
public void Failure()
{
Assert.IsTrue(false);
}
public void Success()
{
}
}
[DependsOn(typeof(A_Fixture))]
[DependsOn(typeof(Bad_Fixture))]
public class B_Fixture
{
[Test]
public void Success()
{
}
}
[DependsOn(typeof(B_Fixture))]
public class B_Child_Fixture
{
[Test]
public void Success()
{
}
}
You can see that B_Child_Fixture depends on B_Fixture. B_Fixture at the same time depends on A_Fixture and Bad_Fixture. As you can see one of the tests in Bad_Fixture will fail. As a result B_Fixture and B_Child will not run.
3 comments:
Thanks Vadim,
Joe
Archaic
I just want to add that MbUnit also takes a method name in DependsOn attribute. This way if you have methods in one testfixture that you want to execute in some order, you can achieve that.
Post a Comment