I've a project in .NET Framework 3.5 and as i can see nUNIT does not support it yet. What unit testing framework would you recommend for my needs?
-
Why do you need explicit support for .NET 3.5? After all, it's still the 2.0 CLR, and if I remember correctly, NUnit supports 2.0.OregonGhost– OregonGhost2009-06-19 08:25:24 +00:00Commented Jun 19, 2009 at 8:25
-
What do you mean by this? I have project in .NET 3.5 and with nUnit 3.5 I get NullReferenceException. So it seems that it's not supportedTom Smykowski– Tom Smykowski2009-06-19 08:52:21 +00:00Commented Jun 19, 2009 at 8:52
-
We've been using NUnit on a 3.5 project for 15 months. It works just fine. But, have you tried creating a new project in 3.5 with just one simple Assert.IsTrue(true) in one single test? That should eliminate the possibility that it is in your code.Mike Two– Mike Two2009-06-20 07:09:09 +00:00Commented Jun 20, 2009 at 7:09
8 Answers
NUnit works perfectly well in .NET 3.5 - I've been using it (with ReSharper running the tests) since the betas of VS2008.
11 Comments
Some other unit testing tools for .NET 3.5 would be:
- MS Test - the built-in unit testing framework in Visual Studio. It's not nearly as bad as its reputation.
- xUnit.NET, which has a very nice API.
Comments
I've been trying out Gallio and it seems to work nicely. It plays nice with ReSharper's unit test runner, too.
[edit]
Just thought I'd mention that Gallio is the next evolutionary step from MbUnit, so it's not an entirely new thing.
Comments
I ran into this issue as well, and was able to work around it, in NUnit 2.5.
In the NUnit GUI, turn on Visual Studio support under Tools > Settings...
Now choose File > Open Project... Change the file filter from "Projects & Assemblies" to "Solutions", and load your solution file. You should be able to run all of your tests.
Now choose File > Save As... and save the current setup as an NUnit project. You can now go into Project > Edit... and remove non-test assemblies or make any other changes you need.
1 Comment
As Jon said NUnit works fine with 3.5.
There are a few things you need to keep in mind:
There are some (very few) obscure breaking changes when you upgrade to later versions of the framework, usually due to the use of deprecated APIs or non-standard methods. In my experience fixing these kind of breaking changes is usually fairly simple once you catch where its coming from.
If you are getting a particular bug with NUnit, isolate it in a tiny test suite. When hunting for bugs I usually assume its my fault and usually I am right.
The source code for nunit is out there you can compile and debug into issues. Testing frameworks, in general, are fairly straight forward and easy to follow.
There are plenty of other unit testing frameworks. The more opinionated XUnit framework is gaining popularity. Personally, I like fluent assertions but its a personal taste thing that can also be achieved with NUnit.
You can always fall back to Microsoft's built in unit testing framework, which ships with VS.