Summary

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 ...

Get C# and .NET Core Test Driven Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.