Need help with EfCore.TestSupport?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

171 Stars 30 Forks MIT License 290 Commits 5 Opened issues


Tools for helping in unit testing applications that use Entity Framework Core

Services available


Need anything else?

Contributors list

No Data



This git repo contains the source of the EfCore.TestSupport library, and various tests to check the EfCore.TestSupport NuGet package.
See Release Notes for information on changes.

This project is open-source (MIT licence) and works for EF Core 2.1 (netstandard2.0) and EF Core 3 (netstandard2.1).


The NuGet package EfCore.TestSupport is a netstandard2.0 library containing methods to help you unit test applications that use Entity Framework Core for database access. This readme defines the various groups, with links to the documentation in the EfCore.TestSupport wiki.

NOTE: The techniques are explained in much more details in chapter 15 of the book Entity Framework in Action.

Here is an image covering just a few of the methods, in bold available in this library.

Examples of libray methods in use

The various groups of tools are:

  1. Helpers to create an in-memory Sqlite database for unit testing.
    See Sqlite in memory test database.
  2. Helpers to create an InMemory database for unit testing.
    See EF InMemory test database.
  3. Helpers to create connection strings with a unique database name.
    See Creating connection strings.
  4. Helpers for creating unique SQL Server databases for unit testing.
    See Create SQL Server databases.
  5. Helpers to create Cosmos DB databases linked to Azure Cosmos DB Emulator.
    See Create Cosmos DB options.
  6. Helpers for creating an empty database, and deleting SQL unit test databases.
    See Quickly create empty databases.
  7. Various tools for getting test data, or file paths to test data.
    See Test Data tools.
  8. A tool for applying a SQL script file to a EF Core database.
    See Run SQL Script.
  9. Tools for capturing EF Core logging.
    See Capture EF Core logging.
  10. Tool to compare EF Core's view of the database with an actual database.
    See EfSchemaCompare.
  11. Capture cleaned production data to supply better data for unit tests.
    See Seed from Production feature.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.