2

We are using mbunit gallio with [TestFixture, Parallelizable] testfixtures and [Test(Order = X), Parallelizable] test attributes, it all works fine apart from test order being effectively ignored no matter what X value we apply, this just doesn't seem to affect the order in which the tests are being executed. Are we doing something wrong here, is there any special trick on using [Test(Order)] or can it be because of we're using Parallelizable ?

Example:

    [TestFixture, Parallelizable]
    public class SignUpTests : BaseTest
    {

    [Test(Order = 2), Parallelizable]
    public void SignUpProcessShouldBeEndedWithConfirmationPageAndWelcomeEmailSent()
    {
        blah-blah-blah;
        blah-blah-blah;
    }

    // we expect this test to be executed before SignUpProcessShouldBeEndedWithConfirmationPageAndWelcomeEmailSent()
    // but it's not the case
    [Test(Order = 1), Parallelizable]
    public void SignUpProcessShouldCompleteAndProvisionedServicesStatusUpdated()
    {
        blah-blah-blah;
        blah-blah-blah;

    }

2 Answers2

0

Try DependsOn attribute , say "Test case 1 " is depends on "Test case 2" , the test case 2 will be executed first and later the test case 1 will be executed.

Lokesh
  • 829
  • 2
  • 14
  • 26
0
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`
}