Friday, February 11, 2011

Choosing a test platform for .NET - MbUnit or the one by Microsoft?

I have chosen these two as primary candidates. My thinking goes like this:

  • MbUnit has had a nice start and enjoys a smart, dedicated team of developers.
  • MSFT has many resources and can compete with MbUnit easily if they choose to do so.

Which one do you believe I should bet on?

  • Microsoft unit testing framework is kind of tied to Visual Studio. This is both an advantage and disadvantage. Advantage is you can run tests easily from Visual Studio out of the box, disadvantage is forget about Mono support. It's worth noting that VS2010 will support 3rd party unit test frameworks.

    Jeff Brown : VS 2008 already supports 3rd party unit test frameworks to a degree. Gallio provides Visual Studio integration for MbUnit, NUnit, xUnit.net and others...
    From joemoe
  • I love MbUnit because it supports parametrized tests through attributes. So you can do something like this:

    [Test]
    [Row(2,1,2)]
    [Row(4,3,1)]
    [Row(ExpectedException(typeof(DivideByZeroException)))]
    void TestIntDivision(int numerator, int denominator, int result)
    {
      Assert.AreEqual(result, numerator/denominator);
    }
    
    Hamish Grubijan : I like! Whatever happened to their servers though?
    Jeff Brown : It's fixed. Just a power outage and a misbehaving VM.
    Daniel Schilling : NUnit now has the same thing with their TestCase attribute in version 2.5.
  • NUnit is more widespread, MbUnit has the most features, but MSTest has more manpower behind it. Check this question out: http://stackoverflow.com/questions/261139/nunit-vs-mbunit-vs-mstest-vs-xunit-net

0 comments:

Post a Comment