A guide to testing .NET Aspire distributed applications, which are programs made of several coordinated services. It covers tests that run the real service setup through an AppHost, the project that describes how those services are arranged.
ASP.NET Core 整合測試的專門技能。當需要測試 Web API 端點、HTTP 請求/回應、中介軟體、依賴注入時使用。涵蓋 WebApplicationFactory、TestServer、HttpClient 測試、記憶體資料庫配置等。 Make sure to use this skill whenever the user mentions ASP.NET Core integration testing, WebApplicationFactory, TestServer, HTTP endpoint testing, or middleware testing, even if they don't…
Guidance for integration tests that use Testcontainers, a library that starts real services in temporary Docker containers, with databases such as SQL Server, PostgreSQL, or MySQL.
A guide for advanced TUnit testing in .NET. TUnit is a testing framework; the guide covers tests driven by data, dependency injection, integration tests, retries, time limits, and filtering.
A guide to using TUnit, a testing framework for .NET applications. It covers creating tests, moving from xUnit, and running tests with compile-time discovery and ahead-of-time compilation.
ASP.NET Core WebApi 整合測試完整指南。當需要對 WebApi 端點進行整合測試或驗證 ProblemDetails 錯誤格式時使用。涵蓋 WebApplicationFactory、IExceptionHandler、Testcontainers 多容器編排、Flurl URL 建構與 AwesomeAssertions HTTP 驗證。 Make sure to use this skill whenever the user mentions WebApi integration testing, ProblemDetails, IExceptionHandler, Flurl, Respawn, or…
A migration guide for updating .NET projects from xUnit 2.9 to xUnit 3, where xUnit is a framework for running automated tests. It covers renamed packages, required runtimes, breaking changes, upgrade steps, new features, and test-container integration.
A guide that routes advanced .NET testing questions to the right specialist instructions. It covers API and integration tests, database and other container-based tests, microservices, .NET Aspire, and related testing tools.
A guide for using AutoFixture, a .NET library that creates test data, with xUnit, a .NET testing framework. It explains attributes such as AutoData, InlineAutoData, and MemberAutoData for supplying values to parameterized tests.
A guide to AutoFixture, a .NET library that creates sample objects and values for tests automatically. It covers creating one object or collections, setting selected properties, and handling circular references.
A guide for combining AutoFixture and Bogus to create test objects with both automatically filled fields and realistic values such as names, email addresses, and phone numbers. AutoFixture creates anonymous test data, while Bogus generates realistic-looking sample data.
A guide to customizing AutoFixture, a .NET library that creates test objects automatically. It covers custom rules for generated values, validation attributes, and reusable builders.
A guide to AwesomeAssertions, a .NET library for writing readable checks in automated tests. It covers checks for objects, collections, strings, numbers, exceptions, and asynchronous code.
A guide to Bogus, a .NET library for generating realistic fake data such as names, addresses, phone numbers, emails, and product records. It shows how to define generation rules and create one or many records.
A guide to code coverage, a measurement of which parts of a program run while tests execute. It explains coverage reports, Coverlet, Visual Studio, and VS Code, and notes that a high percentage alone does not prove the tests are good.
A testing guide for comparing complex .NET objects, including nested data structures, selected properties, and objects that refer back to themselves. DTOs are data-transfer objects used to carry data between parts of an application, while entities usually represent stored data.
A guide for testing .NET code that depends on the current date or time. It uses TimeProvider to supply time and FakeTimeProvider to set, freeze, change, or advance simulated time during tests.
A .NET testing guide for replacing real file and directory operations with an in-memory test file system. `IFileSystem` is the application-facing interface, and `MockFileSystem` supplies the pretend files used by tests.
A guide for testing FluentValidation validators, which are .NET components that check whether data follows rules before the application accepts it. It covers checking validation errors, messages, asynchronous rules, and rules involving multiple fields.
使用 NSubstitute 建立測試替身(Mock、Stub、Spy)的專門技能。當需要隔離外部依賴、模擬介面行為、驗證方法呼叫時使用。涵蓋 Substitute.For、Returns、Received、Throws 等完整指引。 Make sure to use this skill whenever the user mentions mock, stub, spy, NSubstitute, test double, 測試替身, Substitute.For, Returns, Received, or dependency isolation, even if they don't explicitly ask for…
A guide to testing private and internal members in .NET, including design changes, friend-assembly access, and reflection. Private members are available only inside their class; internal members are limited to the same project.
A guide to the Test Data Builder pattern, a way to create test objects from sensible defaults while changing only the fields relevant to each test. It uses readable builder methods such as setting a name or creating an administrator user.