Roadmap › Entity Framework (EF6 & EF Core) › Module: Performance and Advanced
Lessons in this course (15)
15. Testing code that uses EF Core
IntermediateMediumLesson 15 of 15
- In-Memory provider — fast but not relational (no SQL, no constraints, no transactions); Microsoft discourages it for testing DB behaviour.
- SQLite in-memory (
DataSource=:memory:) — relational, fast; some SQL Server differences. - Testcontainers with real SQL Server — most accurate; slower startup (share one container per test run, reset with Respawn).
- Or hide EF behind repositories and mock those for unit tests of business logic.