testcontainers

Orchestrate Docker containers for integration testing with Testcontainers for .NET.

10|Updated Jan 28, 2026
One-click install
npx skills add https://github.com/AGIBuild/Agibuild.Fulora --skill testcontainers-agibuild
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testcontainers
Source: https://github.com/AGIBuild/Agibuild.Fulora/tree/main/.cursor/skills/testcontainers
Command: npx skills add https://github.com/AGIBuild/Agibuild.Fulora --skill testcontainers-agibuild

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill simplifies integration testing by providing a robust framework for spinning up and managing real infrastructure dependencies like databases, message queues, and caches within Docker containers, ensuring tests run against production-like environments.

Core Features & Use Cases

  • Real Infrastructure: Run tests against actual databases (SQL Server, PostgreSQL, MySQL), message brokers (RabbitMQ, Kafka), and caches (Redis).
  • Test Isolation: Each test can have its own isolated instance of a dependency.
  • Automated Lifecycle Management: Testcontainers handles the creation, startup, and cleanup of Docker containers.
  • Use Case: Write integration tests for your data access layer by launching a PostgreSQL container, running your database migrations against it, and then executing your repository methods against the live database.

Quick Start

Use the testcontainers skill to spin up a PostgreSQL container for integration testing.

Frequently Asked Questions about testcontainers

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

FAQPage Schema
How do I run integration tests against real databases using Docker containers?

You can run integration tests against real databases by using Docker containers to spin up live dependencies like PostgreSQL or SQL Server. This approach manages container startup and cleanup automatically, providing isolated, production-like environments for your tests.

What is the best way to isolate integration tests with message brokers and caches?

Isolating integration tests with message brokers and caches is achieved by launching individual Docker containers per test. Each test gets a fresh, isolated instance of dependencies like RabbitMQ, Kafka, or Redis, preventing state leakage across test runs.

Does Testcontainers for .NET support automated lifecycle management for Docker containers?

Testcontainers for .NET provides automated lifecycle management by handling the creation, startup, and cleanup of Docker containers. This ensures dependencies are instantiated and removed automatically, eliminating manual container orchestration during test execution.

Can I use Docker containers to test a data access layer with PostgreSQL?

You can test a data access layer by launching a PostgreSQL container, applying database migrations, and executing repository methods against the live database. This validates your data access logic using a real, containerized PostgreSQL instance.

Why should I use real infrastructure dependencies instead of mocks for integration testing?

Using real infrastructure dependencies instead of mocks ensures tests run against production-like environments. Spinning up actual databases, message queues, and caches in Docker containers validates integration points and catches issues that mocking frameworks often miss.