.NET Core supports three frameworks for writing unit tests, that is, MSTest, NUnit, and xUnit, as shown in the following screenshot:
Initially, the preferred framework for writing test cases was NUnit. Then, MSTest was added to Visual Studio, before xUnit was introduced into .NET Core. xUnit is a very lean version in comparison to NUnit and helps users write clean tests and take advantage of new features. Some of the benefits of xUnit are as follows:
- It is lightweight.
- It uses new features.
- It has improved test isolation.
- The xUnit creator is also from Microsoft and is a tool that's used within Microsoft.
- The Setup and TearDown attributes have been replaced with a constructor and System.IDisposable, thereby forcing the developer to write clean code.
A unit test case is just a simple function that returns void, which is used to test the function...