MbUnit, TDD

Addition to Julian Hidalgo blog on TestSequence attribute.

MbUnit contributor, Julian Hidalgo, blogs about using TestSequence attribute. He points out the typical mistake people have when they try to use this attribute for the first time. When I tried to use it for the first time, I also used TestFixture attribute instead of ProcessTestFixture one.

Julian did a good job of demonstrating how to use it. I would like to add that when you put your tests in ProcessTestFixutre, MbUnit will combine all your tests into one big test. The name of the big test will be all your test names separated by a period in the order specified by TestSequence attribute. For instance, if you have a fixture like the one bellow (borrowed from Julian’s blog), your big test name will be SequenceAttributeTest.Test1.Test2.

    public class SequenceAttributeTest
        private int i = 0;
        public void Test2()
            i += 1;
            Assert.AreEqual(i, 2);

        public void Test1()
            i += 1;
            Assert.AreEqual(i, 1);

Another thing I’d like to mention is that if one of the tests fails, the execution stops. It means that no test will be executed after failed test.  If in example above Test1 fails, Test2 will not be run.

Unfortunately, you cannot use RowTest in ProcessTestFixutre.


3 thoughts on “Addition to Julian Hidalgo blog on TestSequence attribute.

  1. I switched from Blogger because WordPress has more features. Plus I get great stats about my posts with WordPress.

  2. It was certainly interesting for me to read that post. Thanks for it. I like such topics and everything connected to them. I would like to read more soon.

    Best regards

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s