This chapter is about unit testing applications that use EF Core for database access. You’ll learn what unit testing approaches are available for working with EF Core and how to choose the correct tools for your specific needs. I also describe numerous methods and techniques to make your unit testing both comprehensive and efficient. Personally, I think unit testing is useful, and I use it a lot. It makes me a better developer because I can catch bugs both when I develop the code and, more important, when I refactor the code.
But although I really like unit testing, I’m also aware that writing unit tests takes development effort, including refactoring unit tests as the application grows. Over the years, I have learned a lot of tips and techniques for unit testing, and I have built a library called EfCore.TestSupport to help me, and you, write unit tests quickly and efficiently.