dotnet-testing
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesedotnet-testing
.NET测试体系
Overview
概述
Testing strategy, frameworks, and quality tooling for .NET applications. This consolidated skill spans 12 topic areas. Load the appropriate companion file from based on the routing table below.
references/Baseline dependency: defines the unit vs integration vs E2E decision tree and test doubles selection that inform all testing decisions. Load it by default whenever a testing approach needs to be chosen.
references/testing-strategy.mdMost-shared companion: covers xUnit v3 framework features used by integration, snapshot, and UI testing companions.
references/xunit.md本内容涵盖.NET应用的测试策略、框架及质量工具,整合了12个主题领域。请根据下方的路由表,从目录加载对应的配套文件。
references/基础依赖文件:定义了单元测试、集成测试与端到端(E2E)测试的决策树,以及测试替身的选择逻辑,所有测试决策均以此为依据。当需要选择测试方案时,默认加载该文件。
references/testing-strategy.md最常用的配套文件:介绍了集成测试、快照测试和UI测试配套文件所使用的xUnit v3框架特性。
references/xunit.mdRouting Table
路由表
| Topic | Keywords | Description | Companion File |
|---|---|---|---|
| Strategy | unit vs integration vs E2E, test doubles | Unit vs integration vs E2E decision tree, test doubles selection | references/testing-strategy.md |
| xUnit | Facts, Theories, fixtures, parallelism | xUnit v3 Facts, Theories, fixtures, parallelism, IAsyncLifetime | references/xunit.md |
| Integration | WebApplicationFactory, Testcontainers, Aspire | WebApplicationFactory, Testcontainers, Aspire, database fixtures | references/integration-testing.md |
| Snapshot | Verify, scrubbing, API responses | Verify library, scrubbing, custom converters, HTTP response snapshots | references/snapshot-testing.md |
| Playwright | E2E browser, CI caching, trace viewer | Playwright E2E browser automation, CI caching, trace viewer, codegen | references/playwright.md |
| BenchmarkDotNet | microbenchmarks, memory diagnosers | BenchmarkDotNet microbenchmarks, memory diagnosers, baselines | references/benchmarkdotnet.md |
| CI benchmarking | threshold alerts, baseline tracking | CI benchmark regression detection, threshold alerts, baseline tracking | references/ci-benchmarking.md |
| Test quality | Coverlet, Stryker.NET, flaky tests | Coverlet code coverage, Stryker.NET mutation testing, flaky tests | references/test-quality.md |
| Add testing | scaffold xUnit project, coverlet, layout | Scaffold xUnit project, coverlet setup, directory layout | references/add-testing.md |
| Slopwatch | LLM reward hacking detection | Slopwatch CLI for LLM reward hacking detection | references/slopwatch.md |
| AOT WASM | Blazor/Uno WASM AOT, size, lazy loading | Blazor/Uno WASM AOT compilation, size vs speed, lazy loading, Brotli | references/aot-wasm.md |
| UI testing core | page objects, selectors, async waits | Page object model, test selectors, async waits, accessibility testing | references/ui-testing-core.md |
| 主题 | 关键词 | 描述 | 配套文件 |
|---|---|---|---|
| 测试策略 | 单元测试vs集成测试vsE2E测试、测试替身 | 单元测试、集成测试与E2E测试的决策树,测试替身选择逻辑 | references/testing-strategy.md |
| xUnit | Facts、Theories、测试夹具、并行执行 | xUnit v3的Facts、Theories、测试夹具、并行执行、IAsyncLifetime | references/xunit.md |
| 集成测试 | WebApplicationFactory、Testcontainers、Aspire | WebApplicationFactory、Testcontainers、Aspire、数据库测试夹具 | references/integration-testing.md |
| 快照测试 | Verify、数据清理、API响应 | Verify库、数据清理、自定义转换器、HTTP响应快照 | references/snapshot-testing.md |
| Playwright | E2E浏览器测试、CI缓存、跟踪查看器 | Playwright E2E浏览器自动化、CI缓存、跟踪查看器、代码生成 | references/playwright.md |
| BenchmarkDotNet | 微基准测试、内存诊断器 | BenchmarkDotNet微基准测试、内存诊断器、基准对比 | references/benchmarkdotnet.md |
| CI基准测试 | 阈值告警、基准跟踪 | CI环境下的基准测试回归检测、阈值告警、基准跟踪 | references/ci-benchmarking.md |
| 测试质量 | Coverlet、Stryker.NET、不稳定测试 | Coverlet代码覆盖率、Stryker.NET变异测试、不稳定测试处理 | references/test-quality.md |
| 添加测试 | 搭建xUnit项目、Coverlet、目录结构 | 搭建xUnit项目、Coverlet配置、目录布局 | references/add-testing.md |
| Slopwatch | LLM奖励漏洞检测 | 用于LLM奖励漏洞检测的Slopwatch CLI工具 | references/slopwatch.md |
| AOT WASM | Blazor/Uno WASM AOT、体积、懒加载 | Blazor/Uno WASM AOT编译、体积与速度权衡、懒加载、Brotli压缩 | references/aot-wasm.md |
| UI测试核心 | 页面对象模型、选择器、异步等待 | 页面对象模型、测试选择器、异步等待、可访问性测试 | references/ui-testing-core.md |
Scope
适用范围
- Test strategy and architecture (unit, integration, E2E)
- xUnit v3 test authoring
- Integration testing (WebApplicationFactory, Testcontainers)
- E2E browser testing (Playwright)
- Snapshot testing (Verify)
- Benchmarking (BenchmarkDotNet, CI gating)
- Quality (coverage, mutation testing)
- Cross-framework UI testing patterns
- Test scaffolding
- 测试策略与架构(单元、集成、E2E测试)
- xUnit v3测试编写
- 集成测试(WebApplicationFactory、Testcontainers)
- E2E浏览器测试(Playwright)
- 快照测试(Verify)
- 基准测试(BenchmarkDotNet、CI门禁)
- 测试质量(覆盖率、变异测试)
- 跨框架UI测试模式
- 测试项目搭建
Out of scope
不适用范围
- UI framework-specific testing (bUnit, Appium) -> [skill:dotnet-ui]
- CI/CD pipeline configuration -> [skill:dotnet-devops]
- Performance profiling -> [skill:dotnet-tooling]
- 特定UI框架的测试(bUnit、Appium)-> [skill:dotnet-ui]
- CI/CD流水线配置 -> [skill:dotnet-devops]
- 性能分析 -> [skill:dotnet-tooling]