dotnet-integration-testing

Validate .NET API behavior against real infrastructure with WebApplicationFactory and Testcontainers.

Updated Aug 16, 2025
One-click install
npx skills add https://github.com/dodyg/blue-nile-pds --skill dotnet-integration-testing-dodyg
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dotnet-integration-testing
Source: https://github.com/dodyg/blue-nile-pds/tree/main/.agents/skills/dotnet-integration-testing
Command: npx skills add https://github.com/dodyg/blue-nile-pds --skill dotnet-integration-testing-dodyg

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Validates .NET API behavior against real infrastructure using WebApplicationFactory, Testcontainers, and .NET Aspire testing.

Core Features & Use Cases

  • In-process API testing with WebApplicationFactory to exercise the full middleware pipeline without network overhead.
  • Disposable infrastructure via Testcontainers to run real databases, caches, and services in Docker during tests.
  • .NET Aspire support for orchestrated multi-service testing of distributed applications.
  • Database fixture management and test isolation strategies (transactions, Respawn, or isolated containers) to keep tests deterministic.
  • Authentication and authorization test setup to validate security boundaries in integration scenarios.

Quick Start

Start the test run using your existing test project and ensure Docker is running to spin up containers for integration tests.

Frequently Asked Questions about dotnet-integration-testing

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

FAQPage Schema
How do I run .NET integration tests against real databases and services?

You can run .NET integration tests against real infrastructure by using Testcontainers to spin up disposable databases and services in Docker, ensuring tests execute against actual environments rather than mocks.

What is the best way to test a .NET API in-process without network overhead?

In-process .NET API testing uses WebApplicationFactory to exercise the full middleware pipeline directly, validating API behavior without incurring network overhead or requiring a running server.

Does .NET integration testing with Testcontainers require Docker?

Yes, Docker is required to use Testcontainers for .NET integration testing, as it provisions and runs the real databases, caches, and services needed for disposable containerized infrastructure.

How do I keep .NET integration tests deterministic and isolated?

You keep .NET integration tests deterministic by applying test isolation strategies such as transactions, Respawn, or isolated containers to manage database fixtures and reset state between runs.

Can I test distributed .NET applications using Aspire?

Yes, .NET Aspire supports orchestrated multi-service testing for distributed applications, allowing you to validate interactions across multiple services within your integration test suite.

Why do my WebApplicationFactory integration tests fail across different .NET target frameworks?

WebApplicationFactory integration tests fail when the target framework is not aligned with the Microsoft.AspNetCore.Mvc.Testing versions, requiring you to match framework versions for reliable results.