Search code examples
nunitmstestmbunitxunitresharper-6.0

What unit testing framework will meet my requirements?


This is all i'm looking for at a high level:

  1. The ability to run unit tests from within visual studio 2008
  2. Compatibility with some code coverage tool
  3. A unit testing framework with a row testing feature like MBUnit's RowTestAttribute
  4. Ability to integrate with Team City

I thought i had found this with xUnit.net 1.8, resharper 6.0, and dotCover 1.1.1. However, after investing almost a day with messing around with this stuff i've found these major issues with this setup:

  • Theory tests (row tests) are not fully supported in Resharper - more info
  • dotCover basically does not work with xUnit

I was successfully using MSTest with ReSharper to do everything i need but the row tests, but it seems that life could be much better with some of the more advanced testing frameworks.

I've started looking at Gallio, but I'm hoping that someone can save me some time and recommend a winning combination before I waste any more time exploring.

What combination have you used successfully?


Solution

  • I would suggest you to use NUnit:

    • You can use TestDriven.NET or ReSharper to have full integration with Visual Studio
    • PartCover, Sonar, NCover 1.5.8 free as code coverage tool
    • TestCase attribute to pass different set of parameters (ReSharper supports this attribute perfectly)
    • Team City support is built in

    An example for TestCase attribute

     [Test]
     [TestCase(1)]
     [TestCase(2)]
     [TestCase(3)]
     public void TestMe(int param)
     {
        Assert.That(param > 0);
     }