What problem does it solve?
This Skill enables robust integration testing for .NET applications by leveraging real infrastructure components like databases and external services, ensuring your application behaves correctly in a production-like environment.
Core Features & Use Cases
- In-Process API Testing: Use
WebApplicationFactory to test ASP.NET Core APIs without network overhead.
- Containerized Infrastructure: Employ Testcontainers to spin up real databases, message brokers, and other services in Docker containers for isolated testing.
- Orchestrated Testing: Utilize .NET Aspire's testing capabilities to validate multi-service applications and their interactions.
- Database Fixtures: Manage database state with strategies like transaction rollback or data respawning for clean test environments.
- Use Case: Test a web API that relies on a PostgreSQL database by spinning up a PostgreSQL container with Testcontainers, configuring
WebApplicationFactory to use that container's connection string, and then running API endpoint tests against the in-process test server.
Quick Start
Use the dotnet-integration-testing skill to create a new integration test class for an ASP.NET Core API using WebApplicationFactory and Testcontainers for PostgreSQL.