Summary
In this chapter, we explained why it is worth automating software tests, and then we focused on the importance of unit tests. We also listed the various types of tests and their main features, focusing mainly on unit tests and functional tests. We analyzed the advantages of TDD and how to use it in practice. With this knowledge, you should be able to produce software that is both reliable and easy to modify.
Then, this chapter analyzed when it is worth automating some or all functional tests and described how to automate them in ASP.NET
Core applications.
Finally, we analyzed the main test tools available for .NET projects, focusing on xUnit, Moq
, Microsoft.AspNetCore.Mvc.Testing
, and Selenium, and showed how to use them in practice with the help of the book’s use case.
Chapter 21, Case Study, applies all the test concepts described in this chapter to the book’s case study.