dotnet-testing-advanced-webapi-integration-testing

Automate ASP.NET Core WebApi integration tests with WebApplicationFactory and Testcontainers.

28|4|Updated Jan 20, 2026
One-click install
npx skills add https://github.com/kevintsengtw/dotnet-testing-agent-skills --skill dotnet-testing-advanced-webapi-integration-testing
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dotnet-testing-advanced-webapi-integration-testing
Source: https://github.com/kevintsengtw/dotnet-testing-agent-skills/tree/main/skills/dotnet-testing-advanced-webapi-integration-testing
Command: npx skills add https://github.com/kevintsengtw/dotnet-testing-agent-skills --skill dotnet-testing-advanced-webapi-integration-testing

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

這個技能提供在 ASP.NET Core WebApi 專案中進行整合測試的完整指南,涵蓋使用 WebApplicationFactory 建立測試伺服器、全域與自訂異常處理的測試、ProblemDetails 格式驗證,以及使用 Testcontainers 管理多容器測試環境。

Core Features & Use Cases

  • 支援多容器整合測試(PostgreSQL、Redis 等)與時間控制。
  • 使用 Flurl 進行 URL 建構,並以 AwesomeAssertions 驗證 HTTP 回應。
  • 提供可重複使用的測試基底與實作範例,涵蓋建立、查詢、更新、刪除等常見 API 操作。

Quick Start

建立測試專案並參考範例中的 WebApplicationFactory 與 Testcontainers 設定,執行 dotnet test 以執行整合測試。

Frequently Asked Questions about dotnet-testing-advanced-webapi-integration-testing

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

FAQPage Schema
How do I set up integration testing for ASP.NET Core WebApi using WebApplicationFactory?

ASP.NET Core WebApi integration testing uses WebApplicationFactory to create an in-memory test server. This skill provides reusable test bases and implementation examples covering create, query, update, and delete API operations for end-to-end verification.

Can I use Testcontainers for multi-container integration testing with PostgreSQL and Redis?

Yes, Testcontainers supports multi-container integration testing for ASP.NET Core WebApi. This skill enables containerized resources like PostgreSQL and Redis, providing deterministic test infrastructure with time control for reliable end-to-end API execution.

What's the best way to validate ProblemDetails and custom exception handling in WebApi integration tests?

Validating ProblemDetails format and custom exception handling in WebApi integration tests is handled by testing IExceptionHandler implementations. This skill guides verifying global exception responses and validating ProblemDetails schemas using automated HTTP response assertions.

How do I build URLs and verify HTTP responses in ASP.NET Core integration tests?

URL building and HTTP response verification in ASP.NET Core integration tests utilize Flurl for constructing requests and AwesomeAssertions for validating responses. This skill implements these tools to automate HTTP verification across common API operations.

Does this integration testing approach require manual container setup before running dotnet test?

No manual container setup is required before running dotnet test. This skill uses Testcontainers to automatically manage multi-container environments, providing deterministic test infrastructure that spins up containerized resources on demand for isolated execution.