dotnet-integration-testing

Set up .NET integration tests with WebApplicationFactory and Testcontainers.

1|Updated Feb 22, 2026
One-click install
npx skills add https://github.com/rudironsoni/dotnet-agent-harness --skill dotnet-integration-testing-rudironsoni
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dotnet-integration-testing
Source: https://github.com/rudironsoni/dotnet-agent-harness/tree/main/.rulesync/skills/dotnet-integration-testing
Command: npx skills add https://github.com/rudironsoni/dotnet-agent-harness --skill dotnet-integration-testing-rudironsoni

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill provides comprehensive guidance and patterns for performing robust integration testing on .NET applications, ensuring real-world infrastructure interactions are validated.

Core Features & Use Cases

  • In-Process API Testing: Utilize WebApplicationFactory for fast and reliable testing of ASP.NET Core applications without network overhead.
  • External Infrastructure Testing: Employ Testcontainers to spin up real databases, message brokers, and other services in Docker containers for isolated and realistic test environments.
  • Distributed Application Testing: Leverage .NET Aspire testing capabilities to validate multi-service applications in a distributed topology.
  • Use Case: You need to ensure your ASP.NET Core API correctly interacts with a PostgreSQL database, including data persistence and retrieval, under realistic conditions.

Quick Start

Use the dotnet-integration-testing skill to set up a test for your ASP.NET Core API using WebApplicationFactory and Testcontainers for a PostgreSQL database.

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?

ASP.NET Core API integration testing uses WebApplicationFactory to perform fast, in-process testing without network overhead. This approach validates application pipelines and endpoints directly, ensuring reliable test execution within the .NET 8.0+ baseline.

What is the best way to test .NET applications with real databases?

Testing .NET applications with real databases is best handled using Testcontainers. It spins up real databases, message brokers, and services in Docker containers, providing isolated and realistic test environments for validating infrastructure interactions.

Do I need Docker to run .NET integration tests with Testcontainers?

Yes, a Docker daemon is required to run .NET integration tests with Testcontainers. Testcontainers dynamically provisions disposable infrastructure via Docker containers to ensure isolated and realistic test environments during execution.

Can I use .NET Aspire for distributed application testing?

Yes, .NET Aspire provides dedicated testing capabilities for distributed application testing. It allows you to validate multi-service applications within a distributed topology, ensuring all components interact correctly across the network.

How do you manage database fixtures and test isolation in ASP.NET Core integration tests?

Database fixture management and test isolation in ASP.NET Core integration tests are managed by combining WebApplicationFactory with Testcontainers. This strategy uses disposable containerized infrastructure to maintain clean database states across test runs.