9 min read
Testcontainers for ASP.NET Core: Real SQL and Redis Testing
ASP.NET Core integration tests with Testcontainers — real SQL or Postgres and Redis beside WebApplicationFactory. Extends WebApplicationFactory; not Angular E2E.
Blog topic
Real database and service testing for ASP.NET Core — Testcontainers for SQL Server and Redis, and WebApplicationFactory integration tests.
Fast, reliable integration testing without mocking your database away. Start with Testcontainers for ASP.NET Core or WebApplicationFactory integration testing.
This page is the article map for integration and automated testing in ASP.NET Core applications.
| You want… | Open |
|---|---|
| Real SQL & Redis with Testcontainers | Testcontainers for ASP.NET Core |
| Pipeline HTTP tests with WebApplicationFactory | ASP.NET Core integration tests |
Integration tests should test real database behavior, transactions, and HTTP pipelines rather than in-memory mocks.
Related: DevOps & CI/CD · EF Core · API Design
InMemory does not execute raw SQL, foreign keys, transactions, or concurrency tokens. Testcontainers boots real SQL Server in Docker for 100% fidelity: Testcontainers for ASP.NET Core.
Use WebApplicationFactory to send real HTTP requests through middleware: ASP.NET Core integration tests with WebApplicationFactory.
9 min read
ASP.NET Core integration tests with Testcontainers — real SQL or Postgres and Redis beside WebApplicationFactory. Extends WebApplicationFactory; not Angular E2E.
3 min read
Test an ASP.NET Core API through its real pipeline with WebApplicationFactory: replace the database, send HTTP, and check status codes instead of calling controllers as classes.