testing

Create .NET 10 integration tests with WebApplicationFactory and Testcontainers.

Updated Apr 27, 2026
One-click install
npx skills add https://github.com/shahdanish/vibepos --skill testing-shahdanish
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testing
Source: https://github.com/shahdanish/vibepos/tree/main/skills/testing
Command: npx skills add https://github.com/shahdanish/vibepos --skill testing-shahdanish

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you avoid fragile, low-value testing by giving a high-signal strategy for .NET 10 that validates behavior end-to-end with real databases.

Core Features & Use Cases

  • Integration tests with WebApplicationFactory: Validate routing, binding, validation, business logic, and persistence through the full HTTP pipeline.
  • Real database testing with Testcontainers: Replace in-memory databases with PostgreSQL/SQL Server containers to catch real SQL/constraint/transaction issues.
  • Deterministic, robust test design: Apply the AAA pattern (Arrange-Act-Assert), use fakes like FakeTimeProvider for time-dependent logic, and use Verify for snapshot testing when assertions become brittle.
  • Practical coverage decisions: Choose unit vs integration tests based on what you must verify (behavior, database effects, external dependencies).

Quick Start

Load this skill when you set up your test infrastructure and then write your first WebApplicationFactory integration test using AAA with Testcontainers-backed persistence.

Frequently Asked Questions about testing

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

FAQPage Schema
How do I set up real database integration tests in .NET 10?

Real database integration testing in .NET 10 uses Testcontainers to provision PostgreSQL or SQL Server databases dynamically, replacing in-memory databases to expose genuine SQL, constraint, and transaction issues during test runs.

What is the best way to test .NET API endpoints through the full HTTP pipeline?

Testing .NET API endpoints through the full HTTP pipeline is best achieved using WebApplicationFactory, which validates routing, binding, business logic, and persistence end-to-end without mocking the internal application infrastructure.

How does snapshot testing work with xUnit v3 to prevent brittle assertions?

Snapshot testing with xUnit v3 uses the Verify framework to capture and compare serialized output, preventing brittle assertions by simplifying the verification of complex object states and API responses through baseline file comparisons.

How do I handle time-dependent logic in .NET 10 integration tests?

Time-dependent logic in .NET 10 integration tests is handled using FakeTimeProvider, a deterministic clock implementation that allows precise control over time progression to validate timeouts and scheduled tasks reliably.

Do I need Testcontainers for xUnit v3 integration testing or are in-memory databases sufficient?

In-memory databases are insufficient for high-confidence xUnit v3 integration testing. Testcontainers is required to provision real PostgreSQL or SQL Server instances, catching actual SQL, constraint, and transaction issues that in-memory providers miss.

When should I use the AAA pattern for .NET 10 integration tests?

The AAA pattern should be used for all .NET 10 integration tests to structure test logic into Arrange, Act, and Assert phases, ensuring deterministic and robust test design when validating behavior through WebApplicationFactory.