testcontainers-integration-tests

Run Docker-based services for .NET integration tests with TestContainers.

Updated Mar 3, 2026
One-click install
npx skills add https://github.com/Thorstensen/claude-template --skill testcontainers-integration-tests-thorstensen
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testcontainers-integration-tests
Source: https://github.com/Thorstensen/claude-template/tree/main/.claude/skills/testcontainers
Command: npx skills add https://github.com/Thorstensen/claude-template --skill testcontainers-integration-tests-thorstensen

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill enables integration tests against real infrastructure by running Docker containers (Databases, message queues, caches) via TestContainers in .NET, avoiding mocks and ensuring production-like behavior.

Core Features & Use Cases

  • Real Infrastructure in Tests: Spin up containers for databases, caches, and message queues to exercise true behavior.
  • Deterministic Test Lifecycle: Ensure isolated containers and clean state between tests.
  • Production-Style Scenarios: Validate migrations, concurrency, and performance with real services.
  • Ease of Use: Integrates with xUnit and .NET test projects for seamless adoption.

Quick Start

Create an xUnit test class that uses TestContainers to spin up a database container, perform data operations, and assert results.

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 in .NET without using mocks?

Running integration tests without mocks in .NET requires spinning up Docker containers for real services. TestContainers orchestrates these container lifecycles, seeding data and performing assertions with deterministic cleanup to reproduce production-like environments.

What is the best way to test message queues and caches in isolated containers?

Testing message queues and caches in isolated containers is best achieved by using TestContainers to automate Docker-based service lifecycles. This ensures isolated containers and clean state between tests for deterministic, production-style verification.

Does TestContainers work with xUnit for .NET test projects?

TestContainers works seamlessly with xUnit in .NET test projects to automate end-to-end infrastructure verification. It orchestrates container lifecycles for databases and queues, allowing you to perform assertions with deterministic cleanup.

How do I ensure deterministic cleanup between integration tests using Docker containers?

Ensuring deterministic cleanup between Docker integration tests involves applying TestContainers to manage isolated container lifecycles. This approach seeds data and performs assertions, guaranteeing a clean state between test runs.

Do I need Docker to run .NET integration tests for databases and caches?

Docker is required to run these .NET integration tests because TestContainers relies on Docker-based services to spin up databases, caches, and message queues. This reproduces production-like environments for accurate verification.