EF Core offers two fast, infrastructure-free options for unit testing database code: the built-in in-memory provider and SQLite in-memory mode. The in-memory provider stores entities in .NET dictionaries — no SQL, no constraints, ideal for testing business logic above the data layer. SQLite in-memory runs a real SQL engine in RAM, enforcing foreign keys, unique constraints, and transactions, making it the right choice for repository and data-access tests. The guide covers setup for both providers, the critical requirement of keeping the SQLite connection open, implementing a lightweight IDbContextFactory for test isolation, seeding data via separate contexts to avoid change-tracker contamination, xUnit class fixture vs IDisposable patterns, EF Core query logging in tests, and common pitfalls like shared DbContext instances and mixing Migrate() with EnsureCreated(). A decision table maps test types to providers and CI run frequency.