Is there anything I can do in NUnit that I can’t do in MSTest?

  • NUnit contains a [TestCase] attribute that allows implementing parametrized tests. This does not exist out of the box in MSTest – it can be done via extensibility though.
  • MsTest’s ExpectedException attribute has a bug where the expected message is never really asserted even if it’s wrong – the test will pass.
  • NUnit ships with an Assert.Throws API to allow testing an exception on a specific line of code instead of the whole method. A similar feature exists for MSTest (implemented by the same person who did it for NUnit) but does not ship with MSTest.
  • NUnit contains a fluent version of Assert API out of the box. MSTest has third party extensions that do this, but none are shipped with MSTest.
  • NUnit allows abstract classes to be test fixtures (so you can inherit test fixtures). MsTest allows this but limits abstract classes to a single assembly.
  • NUnit allows non public classes to be test fixtures (as of the latest version)
  • NUnit was created SOLELY for the idea of unit testing. MSTest was created for Testing – and also a bit of unit testing.
  • NUnit contains PNunit (running parallel tests with NUnit). MSTest added this ability in Visual Studio 2010 which is configurable via XML

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)