Unit tests can improve the quality of your code and the overall quality of your application. The tests can also serve as a rich source of commentary and documentation for the source code. Creating high-quality unit tests is a skill that should be consciously learned following the guidelines discussed in this chapter.
In this chapter, attributes of a good unit test were discussed. We also extensively discussed unit testing procedures using the testing features available in the xUnit.net framework. The live unit testing feature in Visual Studio 2017 was explained and, using the xUnit.net Fact attribute, assertions were used to create basic unit tests.
In the next chapter, we will explore data-driven unit tests, another important aspect of unit testing, which facilitates using data from different sources, such as from database or CSV files, to execute unit tests. This is...