integration-testing-dotnet

Tests .NET applications across HTTP, database, browser, and Avalonia UI integration boundaries.

7|Updated Jan 11, 2026
One-click install
npx skills add https://github.com/peterblazejewicz/claude-plugins --skill integration-testing-dotnet-peterblazejewicz
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: integration-testing-dotnet
Source: https://github.com/peterblazejewicz/claude-plugins/tree/main/plugins/dotnet-skills/skills/integration-testing-dotnet
Command: npx skills add https://github.com/peterblazejewicz/claude-plugins --skill integration-testing-dotnet-peterblazejewicz

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Unit tests verify logic in isolation but miss bugs that only appear when components interact — middleware ordering, EF Core query translation, HTTP serialization, Blazor rendering, and Avalonia binding failures. This Skill provides concrete patterns for testing .NET systems at their real integration boundaries so those bugs are caught before release. ## Core Features & Use Cases - HTTP API testing: Boots your real Program.cs in-process with WebApplicationFactory<T> and asserts on response status, headers, and serialized bodies. - Database testing: Runs EF Core queries against real PostgreSQL, SQL Server, or Redis instances via Testcontainers, with transaction-rollback isolation between tests. - Browser and desktop UI testing: Drives Blazor, Razor Pages, and MVC views in real browsers with Microsoft.Playwright, and tests Avalonia views headlessly with Avalonia.Headless.XUnit. - Use Case: You changed an EF Core query and an API endpoint. Write a Testcontainers test that runs the query against real Postgres, plus a WebApplicationFactory test asserting the endpoint returns 201 with the correct DTO — catching SQL translation and serialization bugs unit tests would miss. ## Quick Start Write an integration test for my ASP.NET Core task endpoint using WebApplicationFactory and Testcontainers with PostgreSQL.

Frequently Asked Questions about integration-testing-dotnet

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

FAQPage Schema
How do I integration test ASP.NET Core APIs with WebApplicationFactory?

Add the Microsoft.AspNetCore.Mvc.Testing package, expose a partial Program class, and inject WebApplicationFactory<Program> via IClassFixture. Use WithWebHostBuilder to override services or environment, then assert on response status codes and deserialized bodies with an HttpClient.

How to test EF Core queries against a real database in .NET?

Use Testcontainers to spin up a real PostgreSQL or SQL Server container in an IAsyncLifetime fixture, apply migrations once, and wrap each test in a transaction rolled back on dispose. Avoid Microsoft.EntityFrameworkCore.InMemory, which omits relational semantics and lets failing queries pass.

Does Avalonia.Headless.XUnit support xUnit v3?

Avalonia.Headless.XUnit gained xUnit v3 support in Avalonia 12.0. On Avalonia 11.x the package only supports xUnit v2, so headless UI test projects must stay on xUnit v2 even if the rest of the suite uses v3.

Should I use EF Core InMemory provider for integration tests?

No. The InMemory provider does not enforce foreign keys, support raw SQL, or match provider-specific types, so tests pass against it that fail in production. Use Testcontainers with the real database provider for integration tests instead.

Why do my Testcontainers tests pass individually but fail together?

The container fixture is shared across the test collection, so tests must clean up after themselves. Use a transaction rolled back on dispose or a Respawn/TRUNCATE between tests to prevent state leaking across tests.

Can Playwright test Blazor pages without a separate web server?

Yes. Pair Playwright with WebApplicationFactory<Program>'s in-process host and use its Server.BaseAddress as the GotoAsync target. This runs the real app in-process while Playwright drives a headless Chromium browser against it.