When generating Tests with a StaticTestFactory in mbunit, the test suite 
needs to run only if a previous test passes. In the below code sample, The 
test Factory_ShouldNotRun_Test is executed even when the test it depends on 
fails.

The DependsOn atrtibute works with simple tests but not with a 
StaticTestFactory.

Any ideas? Thanks in advance.

Code:


public class Dependency_Test

{

    [Test]

    public  void DependsOnMe_Test()

    {

        Assert.Fail("I fail and dependent tests should be skipped");

    }


    [Test]

    [DependsOn("DependsOnMe_Test")]

    public  void Simple_Test_ShouldNotRun()

    {

        Assert.Fail("Simple test should not run");

    }


    [StaticTestFactory]

    [DependsOn("DependsOnMe_Test")]

    public static IEnumerable<Test> Factory_ShouldNotRun_Test()

    {

        var testCase = new TestCase("Factory_ShouldNotRun_Test", () =>

        {

            Assert.Fail("Factory test should not run");

        });

        yield return testCase;

    }

}


-- 
You received this message because you are subscribed to the Google Groups 
"MbUnit.User" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/mbunituser.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to