shekharpro / mb-unit

Automatically exported from code.google.com/p/mb-unit
0 stars 0 forks source link

Enhancement Request: Independent databound test fixture #435

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
This is more a Enhancement requests than a bug; but I didn't know of a better 
place to send it.

What steps will reproduce the problem?

If you use the code below, without the  "Assert.AreNotEqual(2, value);" line 
the tests run in the 
following order:

value=1/Test1
value=1/Test2
value=2/Test1
value=2/Test2
value=3/Test1
value=3/Test2

With all tests succeeding.

If you run it with the Assert.AreNotEqual(2, value);" line you get the 
following test run
value=1/Test1 (success)
value=1/Test2 (success)
value=2/Test1 (failed)
value=2/Test2 (skipped because of failed dependency)
value=3/Test1 (success)
value=3/Test2 (skipped because of failed dependency)

Where Test2 with value=3 is skipped because Test1 failed with value=2.

I would like a way to specify that the Test2 is dependent on Test1, but only 
for that particular 
databinding values. My reason for this is that I write Selenium remote control 
tests in C# with 
MbUnit; and I use databinding to run the same tests in multiple browsers - but 
a test failing in 
one browser should not cause dependent tests to not run in another browser - as 
the browsers 
are independent.

using MbUnit.Framework;

namespace MBUnitTests
{
    [TestFixture]
    public class Test
    {
        [Row(new object[] { 1 }, Order = 1)]
        [Row(new object[] { 2 }, Order = 2)]
        [Row(new object[] { 3 }, Order = 3)]
        public int value;

        [Test]
        public void Test1()
        {
            Assert.IsTrue(true);
            Assert.AreNotEqual(2, value);
        }

        [Test]
        [DependsOn("Test1")]
        public void Test2()
        {
            Assert.IsTrue(true);
        }
    }
}

What version of the product are you using? On what operating system?

3.0.6 Update 1

Original issue reported on code.google.com by mab...@gmail.com on 30 Apr 2009 at 9:36

GoogleCodeExporter commented 8 years ago
Hmm.  So given Test2 depends on Test1 and they are both within the same 
fixture, the
dependency should only take into consideration failures that occur within the 
same
data-bound instance of that fixture.

This is pretty complex to implement right now but I'll think about it.

Original comment by jeff.br...@gmail.com on 13 May 2009 at 6:15