A narrow integration test checks a small component while exercising a real external dependency. Use it after unit tests when independently developed units must work together, but keep the scope small enough to diagnose failures. section 8.0 section 8.2
For an Entity Framework Core repository, test queries against a real SQLite database because query correctness cannot be established through a fake implementation. Set up an in-memory SQLite connection, keep it alive for the test lifetime, construct the DbContext and repository, then dispose the connection and context. section 8.2
Repository tests with SQLite
Seed comics with numbers 1, 12, and 4, call GetLatestNumberAsync, and assert 12. Separately call AddComicAsync with comic 3, retrieve it from the DbContext, and assert that it exists. These tests exercise repository behavior, EF Core queries, persistence, and the database together without activating a broad application surface.
