malloc();

taking up more space on the interweb

  Home  |   Contact  |   Syndication    |   Login
  13 Posts | 0 Stories | 0 Comments | 7 Trackbacks

News



Tag Cloud


Archives

Post Categories

Image Galleries

code

comics

gadgets

tech

Saturday, May 26, 2007 #

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:
    [RowTest]
    [Row("Hello")]
    [Row("Goodbye")]
    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. http://www.mbunit.com/ 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.

EOF

Technorati tags: , , ,