testcontainers-integration-tests

Run .NET integration tests against Docker containers using TestContainers.

1.1k|101|Updated Nov 12, 2025
One-click install
npx skills add https://github.com/Aaronontheweb/dotnet-skills --skill testcontainers-integration-tests
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testcontainers-integration-tests
Source: https://github.com/Aaronontheweb/dotnet-skills/tree/main/skills/testcontainers
Command: npx skills add https://github.com/Aaronontheweb/dotnet-skills --skill testcontainers-integration-tests

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill enables automated integration testing of services that rely on real infrastructure by running tests against containers managed via TestContainers in .NET, eliminating brittle mocks.

Core Features & Use Cases

  • Orchestrate ephemeral containers for databases, message queues, and caches during tests.
  • Automatic lifecycle management and cleanup of containers to keep test suites deterministic.
  • Fast and reusable test containers with random port mappings to avoid conflicts.
  • Real-world integration testing scenarios suitable for CI pipelines.

Quick Start

Install and reference the TestContainers for .NET package, then write tests that create and start containers in an IAsyncLifetime fixture, access mapped ports, run tests, and let containers clean up afterward.

Frequently Asked Questions about testcontainers-integration-tests

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

FAQPage Schema
How do I run integration tests against real databases instead of mocks in .NET?

You can run integration tests against real databases by using the TestContainers library in .NET to orchestrate Docker containers, which automatically start and clean up services during xUnit test execution.

What is the best way to test message queues and caches in an xUnit test suite?

The best way to test message queues and caches in xUnit is to spin up real services using TestContainers, which manages the Docker container lifecycle and provides random port mappings to keep tests deterministic.

Do I need Docker installed to run TestContainers integration tests?

Yes, you need Docker installed to run TestContainers integration tests, as the Skill relies on the Docker engine to orchestrate and manage ephemeral containers for infrastructure components like databases and queues.

How do I configure container lifecycle and cleanup in xUnit integration tests?

To configure container lifecycle in xUnit integration tests, implement the IAsyncLifetime interface to create and start TestContainers, access mapped ports during test execution, and let the containers clean up automatically afterward.

Can I use TestContainers for .NET integration testing in CI pipelines?

Yes, you can use TestContainers for .NET integration testing in CI pipelines, as it provides fast, reusable containers with automatic lifecycle management and cleanup suitable for deterministic automated test runs.