dotnet-integration-testing

Test .NET applications using WebApplicationFactory, Testcontainers, and .NET Aspire.

71|10|Updated Feb 11, 2026
One-click install
npx skills add https://github.com/wshaddix/dotnet-skills --skill dotnet-integration-testing-wshaddix
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dotnet-integration-testing
Source: https://github.com/wshaddix/dotnet-skills/tree/main/skills/dotnet-integration-testing
Command: npx skills add https://github.com/wshaddix/dotnet-skills --skill dotnet-integration-testing-wshaddix

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill enables robust testing of .NET applications by integrating with real infrastructure components like databases and web servers, ensuring your application functions 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.
  • External Dependency Testing: Leverage Testcontainers to spin up real databases, message brokers, etc., in Docker containers for isolated testing.
  • Orchestrated Application Testing: Utilize .NET Aspire testing utilities to validate multi-service applications.
  • Use Case: Test a web API that relies on a PostgreSQL database by using WebApplicationFactory to send HTTP requests to the API and Testcontainers to provide a live PostgreSQL instance for the API to connect to.

Quick Start

Use the dotnet-integration-testing skill to create a WebApplicationFactory for testing an ASP.NET Core API.

Frequently Asked Questions about dotnet-integration-testing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up integration testing for an ASP.NET Core API using WebApplicationFactory?

Integration testing for an ASP.NET Core API uses WebApplicationFactory to send HTTP requests in-process without network overhead, validating your application logic directly against the configured pipeline.

What is the best way to test a .NET web API against a live PostgreSQL database?

Testing a .NET web API against a live PostgreSQL database is best achieved by combining WebApplicationFactory for in-process HTTP requests with Testcontainers to spin up an isolated, disposable PostgreSQL instance in Docker.

Can I use Testcontainers with .NET Aspire to manage multi-service application testing?

Yes, .NET Aspire testing utilities orchestrate multi-service application testing, while Testcontainers provides disposable infrastructure like databases and message brokers in Docker containers for test isolation.

Do I need .NET 8.0 and Docker to run Testcontainers for integration tests?

Yes, Testcontainers requires Docker to provision real infrastructure components, and the testing patterns require a .NET 8.0+ baseline along with Testcontainers 3.x+ and .NET Aspire 9.0+ if using Aspire utilities.

How do I manage database fixtures and ensure test isolation in .NET integration tests?

Database fixture management and test isolation in .NET integration tests are handled by spinning up disposable infrastructure via Testcontainers, ensuring each test run interacts with a clean, real database instance.

Why use Testcontainers instead of mocks for .NET integration testing?

Using Testcontainers instead of mocks for .NET integration testing spins up real databases and message brokers in Docker, ensuring your application functions correctly in a production-like environment rather than against simulated dependencies.