This project is open-source (MIT licence).
See Release Notes for information on changes.
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.
The various groups of tools are:
- Helpers to create an in-memory Sqlite database for unit testing.
See Sqlite in memory test database.
- Helpers to create an InMemory database for unit testing.
See EF InMemory test database.
- Helpers to create connection strings with a unique database name.
See Creating connection strings.
- Helpers for creating unique SQL Server databases for unit testing.
See Create SQL Server databases.
- Helpers for creating an empty database, and deleting SQL unit test databases.
See Quickly create empty databases.
- Various tools for getting test data, or file paths to test data.
See Test Data tools.
- A tool for applying a SQL script file to a EF Core database.
See Run SQL Script.
- Tools for capturing EF Core logging.
See Capture EF Core logging.
- Tool to compare EF Core's view of the database with an actual database.