How should EF Core code be tested?
Test business behavior at the level where it matters. Pure domain logic should usually be tested without EF Core, while persistence behavior such as mappings, constraints, transactions, query translation, and concurrency requires tests that exercise a real relational provider. Keep tests deterministic and give each test isolated data.