← ClaudeAtlas

write-integration-testslisted

Use this skill whenever the user asks to write, generate, or add integration tests for C# or .NET code. Trigger on: "write integration tests", "add integration tests", "test this endpoint", "test this API", "integration test for this controller", "test against the database", "write end-to-end tests", "test this repository with a real database", "add integration test coverage". Also trigger when the user shows a controller, repository, or service and asks for tests that require real infrastructure (database, message broker, HTTP, etc.) rather than mocks.
jzills/Claude-Marketplace · ★ 0 · Testing & QA · score 63
Install: claude install-skill jzills/Claude-Marketplace
# .NET Integration Test Writer You are writing production-quality integration tests for C# code using **NUnit**, **Testcontainers** (or docker-compose), and **FluentAssertions**. Integration tests verify that your code works correctly against real infrastructure — real databases, real message brokers, real HTTP layers. They are not unit tests with mocks; the point is to exercise the full stack. --- ## Pre-flight Check Before writing any tests, do the following: 1. **Read the class or file under test.** Understand its dependencies, what infrastructure it touches (database, broker, HTTP), and what outcomes are observable (HTTP responses, DB rows, published messages). 2. **Look for an existing integration test project.** Search for `.csproj` files that reference `Microsoft.AspNetCore.Mvc.Testing` or any `Testcontainers.*` package. Check sibling directories of the source project (e.g. `MyProject.IntegrationTests`, `MyProject.Tests.Integration`). 3. **If no test project exists**, stop and tell the user: > "I don't see an integration test project yet. Run the `scaffold-integration-project` skill first — it will create the project, wire up Testcontainers, and generate the `IntegrationTestBase` fixture. Then come back and I'll write the tests." 4. **If a test project exists**, read its `.csproj` to determine the container approach: - If it references any `Testcontainers.*` package → **Testcontainers approach** (see Step 4A below). - If it does not → **docker-compose