7

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?
pnuts
  • 58,317
  • 11
  • 87
  • 139
oo_olo_oo
  • 2,815
  • 5
  • 28
  • 25
  • possible duplicate of [NUnit vs. MbUnit vs. MSTest vs. xUnit.net](http://stackoverflow.com/questions/261139/nunit-vs-mbunit-vs-mstest-vs-xunit-net) – nawfal Jul 23 '14 at 15:18

4 Answers4

15

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: xUnit - Comparing xUnit.net to other frameworks

dey.shin
  • 990
  • 10
  • 21
Mehrdad Afshari
  • 414,610
  • 91
  • 852
  • 789
3

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

dey.shin
  • 990
  • 10
  • 21
Kent Boogaart
  • 175,602
  • 35
  • 392
  • 393
1

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
  • 2,458
  • 24
  • 36
0

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
  • 10,570
  • 12
  • 44
  • 60