Skip to content
Tools for helping in unit testing applications that use Entity Framework Core
Branch: master
Clone or download
Type Name Latest commit message Commit time
Failed to load latest commit information.
Net472Test Added NET 4.7.2 unit test to find problem with getting directory when… Mar 19, 2019
Test Version 1.8.0. - add features to CompareEfSql Mar 25, 2019
Example-of-various-test-features.png uploaded correct image Oct 8, 2017
LICENSE Version 1.8.0. - add features to CompareEfSql Mar 25, 2019



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

This project is open-source (MIT licence).


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 for creating an empty database, and deleting SQL unit test databases.
    See Quickly create empty databases.
  6. Various tools for getting test data, or file paths to test data.
    See Test Data tools.
  7. A tool for applying a SQL script file to a EF Core database.
    See Run SQL Script.
  8. Tools for capturing EF Core logging.
    See Capture EF Core logging.
  9. Tool to compare EF Core's view of the database with an actual database.
    See EfSchemaCompare.
You can’t perform that action at this time.