-
Notifications
You must be signed in to change notification settings - Fork 56
Old docs
This document has links to documentation for the EfCore.TestSupport, version 3.2.0.
-
Helpers to create a Sqlite in-memory database for unit testing
-
Helpers to create connection strings with a unique database name (via appsetting.json)
-
Helpers for creating unique SQL Server databases for unit testing
-
Helpers for creating unique SQL Server databases for unit testing
-
Helpers to create Cosmos DB databases linked to Azure Cosmos DB Emulator
-
Ways to make sure your database has an up-to-date schema and is empty
-
Various tools for getting test data, or file paths to test data
-
EfSchemaCompare, a tool for people using SQL scripts to migrate their database
In NET Core the EfCore.TestSupport features work when running the unit tests via Visual Studio Test Explorer, or any other test runner such as Resharper.
In NET Framework, by default, EfCore.TestSupport methods that accessing files or appsettings fails when running via Visual Studio Test Explorer (but resharper works). This is because the NET Framework XUnit runner defaults to using a shadow copy. The solution is to add a XUnit configuration file to turn off the shadow copy. I have added a project called Net472Test
to test this and you can find my XUnit xunit.runner.json file here that provides the correct setup. NOTE: read the XUnit config docs as you need to set the file properties for it to work.
- Testing against a PostgreSQL db
- Changes in EfCore.TestSupport 5
- Testing with production data
- Using an in-memory database (old)