Exploring other testing frameworks
Beyond xUnit, the next most popular testing frameworks are NUnit and MSTest.
These two frameworks operate in very similar ways to xUnit but with slight differences in the syntax you use to declare a unit test.
I’ve had the opportunity to program professionally and recreationally in all three major testing frameworks and I can tell you that these differences are largely cosmetic. That said, you will find that certain frameworks have specific features that might not be present in the others.
Testing with NUnit
Of the three testing frameworks, NUnit’s syntax is my favorite because it uses the Test
name for both unit tests that require no parameters (equivalent to an xUnit Fact
) and those that do (equivalent to an xUnit Theory
).
Here’s a parameterized test that verifies the Load
method on PassengerFlightInfo
:
public class PassengerFlightTests { [TestCase(6)] public...