Question

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?

Was it helpful?

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);
 }

OTHER TIPS

  1. Integration with IDE: Out of the box and free => MSTest. If you're willing to download and use, there is a plethora of test runners.. NUnit being the oldest. If you're willing to pay, you have resharper, test-driven.net and the other add-ins. Resharper has its own bundled in test runner - so that's why you see those niggling issues. Now if you want to run and debug, then your options would be cut down even more. Running is as easy as setting the program to debug as your unit test runner exe. Bottomline: Integration for anything other than MSTest, has to be paid for/downloaded.
  2. Compatibility with code coverage: Again out of the box and free => MSTest. Paid: NCover will integrate with any exe... so not a constraint (but costs a bit too much IMHO). There are others too cropping up now - with Jetbrains throwing their own variant, I'm assuming compatibility will be a given among their own products.
  3. RowTests : NUnit has this. Although I think it was borrowed from xUnit or MBUnit, I forget. MSTest supports this as a downloadable extension.
  4. Integrate with Team City : See their page: Seems to work with NUnit and MSTest only. I have personally checked it out with NUnit.. worked with minimal configuration.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top