testing

Structure .NET 10 xUnit and integration tests with WebApplicationFactory and Testcontainers.

224|87|Updated Dec 15, 2018
One-click install
npx skills add https://github.com/Resgrid/Core --skill testing-resgrid
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testing
Source: https://github.com/Resgrid/Core/tree/main/.opencode/skills/testing
Command: npx skills add https://github.com/Resgrid/Core --skill testing-resgrid

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill reduces flaky or low-signal test suites by showing how to structure .NET 10 tests for maximum coverage of behavior, including integration scenarios.

Core Features & Use Cases

  • High-value integration testing: Use WebApplicationFactory to exercise the full HTTP pipeline (routing, validation, business logic, persistence) with deterministic fixtures.
  • Real database confidence: Use Testcontainers to run real PostgreSQL/SQL Server in tests instead of hiding issues with in-memory providers.
  • Maintainable, readable tests: Apply the AAA pattern (Arrange, Act, Assert), verify snapshot responses for complex objects, and handle time-dependent logic with FakeTimeProvider.

Quick Start

Load this Skill when setting up your .NET 10 test infrastructure or when you’re improving or reviewing your test coverage for xUnit, integration tests, Testcontainers, Verify, or time-dependent logic.

Frequently Asked Questions about testing

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

FAQPage Schema
How do I write reliable .NET integration tests that catch real bugs?

Structure reliable .NET integration tests using WebApplicationFactory to exercise the full HTTP pipeline and Testcontainers for real database validation, ensuring your tests catch actual bugs instead of hiding issues with in-memory providers.

Why does using in-memory databases cause flaky xUnit tests?

In-memory databases cause flaky xUnit tests by hiding real persistence issues. Using Testcontainers to run actual PostgreSQL or SQL Server containers provides real database confidence and prevents low-signal test suite failures.

What is the best way to handle time-dependent logic in .NET testing?

Handle time-dependent logic in .NET testing by using FakeTimeProvider for deterministic time manipulation. This ensures your xUnit tests remain reliable and repeatable without relying on actual system clock behavior.

Can I use snapshot testing with Verify for complex .NET objects?

Yes, you can use snapshot testing with Verify for complex .NET objects. It allows you to verify snapshot responses easily, keeping your integration tests maintainable while validating full HTTP API response structures.

Does WebApplicationFactory support testing full HTTP pipelines in .NET 10?

Yes, WebApplicationFactory supports testing full HTTP pipelines in .NET 10. It exercises routing, validation, business logic, and persistence with deterministic fixtures for high-value integration testing workflows.

When do I need to use Testcontainers instead of in-memory providers for database tests?

You need Testcontainers instead of in-memory providers when requiring real database confidence. Testcontainers runs actual PostgreSQL or SQL Server containers to prevent hidden issues and validate true persistence behavior in xUnit tests.