In addition to DI, it is also important to write unit tests to build robust software. By automating your tests, you can minimize the chances of bugs in your code and generate confidence when adding new features.
Many articles and a few books have been written on unit testing, so this section is by no means a comprehensive reference on it. Instead, its intent is to introduce you to the possibilities of automated testing in your code.
ASP.NET developers have been using various unit testing frameworks over the years. The list of testing frameworks includes nUnit, xUnit.net, and Microsoft's own MSTest. All of these products have the same basic capabilities and some advanced capabilities as well. To extend the functionality, developers can use mocking frameworks such as Moq (pronounced Mock-You or Mock).
Since the introduction of ASP.NET Core through various Beta versions, xUnit.net has been made available and is ready for use. Although MSTest was not...