views:

617

answers:

4

I'm rather beginner in C# world (and .Net as well), so I decided to get some advices from more experienced developers. Which free unit testing framework for C# would you advise? I came across NUnit, which seemed to look interestingly, but in it's documentation I found out, that there were versions for .Net 1.1 and .Net 2.0. I need to use it in project targeted to .Net 3.0.

So, please let me know if:

  • I can use NUnit for .Net 3.0 project?

or:

  • there is something better than NUnit?
+11  A: 

Yes. NUnit works well on .NET 3.0 and 3.5 too.

Your second question is pretty subjective. NUnit is a widely used unit testing framework for .NET. MSTest is another one that is shipped with Visual Studio. xUnit is another one. There is a comparison on xUnit project: http://xunit.codeplex.com/Wiki/View.aspx?title=Comparisons

Mehrdad Afshari
+1 NUnit, if you're using VisualStudio, TestDriven.NET is a terrific add-on.
plinth
+1  A: 

xUnit is worth a look (and is what I use the most), as is MbUnit.

HTH, Kent

Kent Boogaart
+1  A: 

Well it depends on your IDE. If you've purchased, or your employer purchased, a Visual Studio edition that comes with the MSTest then I'd go with that, just less to install and configure. Otherwise go with NUnit, it's simple, easy to use and widely used and accepted by .NET Devs.

Alexander Kahoun
+1 and pex works flawlessly with MSTest as well.
SnOrfus
A: 

I would say stick with NUnit. It's a good testing framework, and does work with 3.0 (it's what I currently use, and what we used at my last employer as well)

PsychoCoder