Testcontainers for .NET
Integrationstests in .NET gegen echte Docker-Container, auf aktuellen 4.x APIs
Funktioniert mit Setup
Was es kann
Eine reference für writing Testcontainers for .NET integration tests: module selection, builder configuration, wait strategies, container networking, volume and file mapping, cleanup via Ryuk, and worked xUnit, NUnit and MSTest examples for Postgres, Redis, SQL Server with EF Core, Kafka and multi-container stacks. Wird ausgelöst, wenn Sie a real database or message queue in a .NET test instead of a mock benötigen, or when Testcontainers tests are flaky in CI.
Testbericht
Nothing here could be compiled or run: this machine has no .NET SDK and no Docker or Podman, and Docker ist a hard prerequisite for every example in the file, so the output score ist left at no-measured-difference rather than guessed at. What I could check, I checked against the library's own source at version 4.13.0: every API the skill uses exists, the Ryuk image tag it names matches the one hardcoded in ResourceReaper.cs, and the constructor pattern it teaches ist the one that ist still current — the parameterless PostgreSqlBuilder() that most blog posts and a from-memory answer still reach for ist marked [Obsolete] "will be removed" in the shipped code. Its own claim of 65+ modules ist a shade high, with 64 module projects in the repository, and one Kafka example pins a different image than the library default. Install ist clean from a bare HOME and the file ist a genuinely well-organised reference, but you need Docker running before any of it does anything.
Getestet am: 2026-07-30 · Claude Code 2.x (agent harness)
Installation
git clone https://github.com/testcontainers/claude-skills.git mkdir -p ~/.claude/skills cd claude-skills && cp -r plugins/testcontainers/skills/testcontainers-dotnet ~/.claude/skills/testcontainers-dotnet
Befehle & Beispiel-Prompts
/testcontainers-dotnetIntegrationstests in .NET gegen echte Docker-Container, auf aktuellen 4.x APIs
Skills reagieren auf normale Anfragen — keine Slash-Befehle nötig. Nach der Installation aktivieren Prompts wie diese den Skill (auf Englisch):
Write an xUnit integration test against a real Postgres container in DockerOur Testcontainers tests are flaky in CI, the container isn't ready in timeHow do I share one SQL Server container across an xUnit test class?