views:

162

answers:

1

I'm using NUnit (but have also tried this with VS testing) and I'm having a problem getting TestDriven.Net to recognize and run different test fixtures in a single .cs file.

I'm trying to do a little BDD style testing. So what I have in one file is something like this:

[TestFixture]
public class when_view_is_ready : AAA
{
  // setup, tests
}

[TestFixture]
public class when_something_happens : AAA
{
   // setup, tests
}

When I run this in the NUnit GUI runner it sees the different test fixtures just fine and runs all the tests. When I run it via TestDriven.NET context menu and watch the Output window, it only runs the first fixture's tests. Is there a reason for this? Can this be fixed?

I think I'm running TestDriven.Net 2.0. I can't be certain; not exactly sure how to check my version.

Appreciate any help!

+2  A: 

You can check the version of TestDriven in Help -> About in Visual Studio, or in Tools -> Addin Manager.

I can confirm that this is an issue in 3.0.2556, when running tests it runs only the first TestFixture in the file, when you right-click the file, and select "Run Tests". When you right-click on the containing directory or project, and "Run Tests", it runs both fixtures.

When using other test runners, like Resharper's testrunner, even running it on the file runs both fixtures.

Best thing to do, is probably to report a bug with TestDriven.net

Sander Rijken
Thanks Sandy. That's the confirmation I was looking for. I can run it in NUnit test runner and it runs all tests. The only time it doesn't run all the tests is when I right-click on the file in Solution Explorer, and that just happens to be the method I use most for testing. Bummer.
Chris Holmes