Chapter 20. Testing your application

This chapter covers

  • Creating unit test projects with xUnit
  • Writing unit tests for custom middleware and MVC controllers
  • Using the Test Host package to write integration tests
  • Testing code dependent on EF Core with the in-memory database provider

When I first started programming, I didn’t understand the benefits of automated testing. It involved writing so much more code—wouldn’t it be more productive to be working on new features instead? It was only when my projects started getting bigger that I appreciated the advantages. Instead of having to manually run my app and test each scenario, I could press Play on a suite of tests and have my code tested for me automatically.

Testing is universally accepted ...

Get ASP.NET Core in Action 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.