Testcontainers for .NET
Test di integrazione in .NET contro container Docker reali, sulle API 4.x attuali
Richiede configurazione
Cosa fa
Un reference per scrivere Testcontainers for .NET integration tests: module selection, builder configuration, wait strategies, container networking, volume and file mapping, cleanup via Ryuk, ed esempi worked xUnit, NUnit e MSTest per Postgres, Redis, SQL Server with EF Core, Kafka e multi-container stacks. Si attiva quando hai bisogno di un real database o message queue in un .NET test instead of a mock, o quando Testcontainers tests are flaky in CI.
Rapporto di test
Nulla qui potrebbe essere compilato o eseguito: questa macchina non ha .NET SDK e nessun Docker o Podman, e Docker è un hard prerequisite per every example in the file, so the output score is left at no-measured-difference rather than guessed at. Ciò che ho potuto controllare, l'ho confrontato con il 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 is the one that is still current — the parameterless PostgreSqlBuilder() that most blog posts and a from-memory answer still reach for is marked [Obsolete] "will be removed" in the shipped code. Its own claim of 65+ modules is a shade high, with 64 module projects in the repository, and one Kafka example pins a different image than the library default. Install is clean from a bare HOME and the file is a genuinely well-organised reference, but you need Docker running before any of it does anything.
Testato il: 2026-07-30 · Claude Code 2.x (agent harness)
Installazione
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
Comandi e prompt di esempio
/testcontainers-dotnetTest di integrazione in .NET contro container Docker reali, sulle API 4.x attuali
Gli skill si attivano con richieste in linguaggio naturale, senza comandi da ricordare. Dopo l'installazione, prompt come questi lo attivano (in inglese):
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?