Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.NET unit testing packages [closed]

I am getting back into a bit more .NET after a few-years of not using it full-time and am wondering what the good unit testing packages are these days.

I'm familiar with NUnit (a few years ago) and have played briefly around with IronRuby, with the goal of getting something like RSpec going, but I don't know much beyond that.

I realize I could google for this and call it a day, but I believe I'm likely to get a better and more informed response from asking a question here :-)

Suggestions?

like image 717
Orion Edwards Avatar asked Aug 05 '08 00:08

Orion Edwards


People also ask

Is MSTest deprecated?

Test projects that are Coded UI tests or Web Load Tests are not compatible with MSTestV2. These project types have been deprecated.

Which is better NUnit or MSTest?

The main difference is the ability of MsTest to execute in parallel at the method level. Also, the tight integration of MsTest with Visual Studio provides advantages in both speed and robustness when compared to NUnit. As a result, I recommend MsTest.

Does NUnit work with .NET core?

Sdk version 17.0. 0 to your NUnit test projects will also enable the dotnet test command for . NET Core projects.

Is unit testing end to end?

End-to-end testing is a testing process in which the tester tests a software application from the user's perspective. Unit testing is a testing process where the developer verifies that individual units of source code work correctly.


2 Answers

There are so many it's crazy. Crazy good, I guess.

  • For the conservative types (me), NUnit is still available and still more than capable.
  • For the Microsoft-types, MSTest is adequate, but it is slow and clunky compared to NUnit. It also lacks code coverage without paying the big bucks for the pricey versions of Visual Studio.
  • There's also MbUnit. It's like NUnit, but it has nifty features like RowTest (run the same test with different parameters) and Rollback (put the database back like you found it after a test).
  • And finally, xUnit.net is the trendy option with some attitude.
  • Oh, and TestDriven.NET will give you IDE integration for both NUnit and MbUnit.

I'm sure they're all just fine. I'd steer away from MSTest though, unless you just enjoy the convenience of having everything in one IDE out of the box.

Scott Hanselman has a podcast on this very topic.

like image 183
Brad Tutterow Avatar answered Sep 21 '22 13:09

Brad Tutterow


Stick to NUnit. Don't go anywhere near MSTest.

NUnit + ReSharper is an absolute joy to work with.

like image 24
Iain Holder Avatar answered Sep 22 '22 13:09

Iain Holder