Skip to main content
skill CX Codex

testcontainers — Claude Code skill for .NET integration tests

A skill for .NET integration tests: spins up real databases, Redis and message brokers in Docker instead of mocks.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add wshaddix/dotnet-skills --skill testcontainers -a claude-code
Open on GitHub

What testcontainers does

This skill lays out Testcontainers patterns for .NET integration tests. Your tests talk to actual SQL Server, PostgreSQL, MySQL, Redis, RabbitMQ or Kafka instances, each in its own container. Containers get random ports, so parallel runs don't collide, and Testcontainers handles the lifecycle for you.

Inside are C# examples: a test class implements IAsyncLifetime, InitializeAsync starts the container and opens a connection, DisposeAsync tears everything down. It also covers the NuGet packages you need (Testcontainers, xunit, database drivers), readiness checks with WaitStrategy, migrations, and clearing data between tests. Reference files go deeper on database containers, message brokers, and advanced setups like networks and volumes.

Docker is required. No running daemon means containers never start and your tests fail during setup — worth checking before you wire this into CI. The sample connection strings and passwords sit right in the code, so move them to configuration for a real project.

What it helps with

  • verify SQL queries and constraints against a real database instead of mocks
  • spin up RabbitMQ or Kafka in a test and confirm messages arrive
  • run migrations and schema changes before a deploy
  • isolate tests from each other with separate containers
  • check Redis caching behavior without hand-building an environment

Example prompts for the agent

  • write an integration test for the orders repository using Testcontainers and PostgreSQL
  • add IAsyncLifetime to the test class and start a SQL Server container
  • check that migrations apply cleanly to a fresh database in a container

How to install testcontainers

1Skills CLI (Vercel)

npx skills add wshaddix/dotnet-skills --skill testcontainers -a claude-code

2Manually: put the files in place

~/.claude/skills/testcontainers/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/testcontainers/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about testcontainers

How do I install testcontainers in Claude?

Run npx skills add wshaddix/dotnet-skills --skill testcontainers -a claude-code. The skill lands at ~/.claude/skills/testcontainers/SKILL.md.

What does the testcontainers skill do?

It documents Testcontainers patterns for .NET integration tests: running real databases, Redis and message brokers in Docker containers instead of mocks.

What do I need for the skill to work?

Docker with a reachable daemon, plus NuGet packages: Testcontainers, xunit and the driver for your database or broker.

Similar skills

Everything for Testing and QA →

From the same set5

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor