Geeks With Blogs
malloc(); taking up more space on the interweb

Thanks to Andrew Stopford and everyone else who works on MbUnit development. MbUnit 2.4 was just released.

If you are not unit testing or practicing TDD in your projects, I don't know how you could choose plain old NUnit over MbUnit. If you are using regular NUnit it is very simple to convert your projects MbUnit, they use the same [Test] attribute.

MbUnit has:

  • Row Testing:
    public void TestString( string myString )
        // do your tests in here...
    More row testing details here.
  • Specialized Assertions
  • Database rollback. The unit testing gods say that there should be absolutly no DB access in unit tests, but there are some times when I cannot avoid it. With the rollback attribute I don't have to worry about cleaning up the database after my test runs
  • Being able to test private methods. (see Vadim Kreynin's articles here and here). *
  • Extract Embedded Resources With An Attribute In MbUnit. No more dealing with test file directories or setting the correct path in the [SetUp] methods!
  • RepeatAttribute. Run a specific test multiple times in a row.
  • ThreadedRepeatAttribute. Run a specific test on multiple threads.
  • etc. for all the details.

 * I have been using the InternalsVisibleTo assembly attribute to accomplish this for a little while now. It gets the job done nicely and has allowed complete separation of our unit tests into a separate assembly. It does require you to change method signatures to internal instead of private, OO purists might feel dirty doing this. Derik Whittaker had a good example on how the attribute should be used.


Technorati tags: , , ,
Posted on Saturday, May 26, 2007 7:13 PM .net , MbUnit , TDD | Back to top

Comments on this post: MbUnit 2.4

No comments posted yet.
Your comment:
 (will show your gravatar)

Copyright © malloc(); | Powered by: