Is there an MBUnit attribute to run Row tests in the order in which they were defined

I tried searching for this but found nothing. Basically, I would like to run each line in the order that I defined. For example, if I have this:

[Row("a")]
[Row("b")]
[Row("c")]
[Test]
public void Test(string s)...

I want to be sure that test A runs before test B, and test B runs before test C.

+3
source share
2 answers

As stated in the C # language specification (p. 375):

The order in which the attributes are specified (...) does not matter. For example, attribute specifications [A] [B], [B] [A], [A, B], and [B, A] are equivalent.

, , . , Gallio/MbUnit , . .

[Row("a", Order = 1)]
[Row("b", Order = 2)]
[Row("c", Order = 3)]
[Test]
public void Test(string s)
{
}

, Order . , [Test], , .


, , , [Column] [Row]; , 3 1:

[Test]
[Column("a", "b", "c")]
public void Test(string s)
{
}
+5
Include 'MbUnit.Framework.TestSequence(1)' and use ProcessTextFixture instead  of TextFixture.
  [ProcessTextFixture]
 public class TestSequeunce
{

    [MbUnit.Framework.TestSequence(1)]
    [TEST]
    public void TestMethod1()
    {
    }

    [MbUnit.Framework.TestSequence(2)]
    [TEST]
    public void TestMethod1()
    {
    }`enter code here`
}
0

Source: https://habr.com/ru/post/1764990/


All Articles