15 Unit testing EF Core applications

This chapter covers

  • Simulating a database for unit testing
  • Using an in-memory database for unit testing
  • Using real databases for unit testing
  • Unit testing a disconnected state update
  • Capturing logging information while unit testing

This chapter is about unit testing applications that use EF Core for database access. You’ll learn what unit-testing approaches are available 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.

Unit testing is a big subject, with whole books dedicated to the topic. I focus on the narrow, but important, area of unit-testing applications that use EF Core for ...

Get Entity Framework 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.