dotnet-testing

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

dotnet-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
references/
based on the routing table below.
Baseline dependency:
references/testing-strategy.md
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.
Most-shared companion:
references/xunit.md
covers xUnit v3 framework features used by integration, snapshot, and UI testing companions.
本内容涵盖.NET应用的测试策略、框架及质量工具,整合了12个主题领域。请根据下方的路由表,从
references/
目录加载对应的配套文件。
基础依赖文件:
references/testing-strategy.md
定义了单元测试、集成测试与端到端(E2E)测试的决策树,以及测试替身的选择逻辑,所有测试决策均以此为依据。当需要选择测试方案时,默认加载该文件。
最常用的配套文件:
references/xunit.md
介绍了集成测试、快照测试和UI测试配套文件所使用的xUnit v3框架特性。

Routing Table

路由表

TopicKeywordsDescriptionCompanion File
Strategyunit vs integration vs E2E, test doublesUnit vs integration vs E2E decision tree, test doubles selectionreferences/testing-strategy.md
xUnitFacts, Theories, fixtures, parallelismxUnit v3 Facts, Theories, fixtures, parallelism, IAsyncLifetimereferences/xunit.md
IntegrationWebApplicationFactory, Testcontainers, AspireWebApplicationFactory, Testcontainers, Aspire, database fixturesreferences/integration-testing.md
SnapshotVerify, scrubbing, API responsesVerify library, scrubbing, custom converters, HTTP response snapshotsreferences/snapshot-testing.md
PlaywrightE2E browser, CI caching, trace viewerPlaywright E2E browser automation, CI caching, trace viewer, codegenreferences/playwright.md
BenchmarkDotNetmicrobenchmarks, memory diagnosersBenchmarkDotNet microbenchmarks, memory diagnosers, baselinesreferences/benchmarkdotnet.md
CI benchmarkingthreshold alerts, baseline trackingCI benchmark regression detection, threshold alerts, baseline trackingreferences/ci-benchmarking.md
Test qualityCoverlet, Stryker.NET, flaky testsCoverlet code coverage, Stryker.NET mutation testing, flaky testsreferences/test-quality.md
Add testingscaffold xUnit project, coverlet, layoutScaffold xUnit project, coverlet setup, directory layoutreferences/add-testing.md
SlopwatchLLM reward hacking detectionSlopwatch CLI for LLM reward hacking detectionreferences/slopwatch.md
AOT WASMBlazor/Uno WASM AOT, size, lazy loadingBlazor/Uno WASM AOT compilation, size vs speed, lazy loading, Brotlireferences/aot-wasm.md
UI testing corepage objects, selectors, async waitsPage object model, test selectors, async waits, accessibility testingreferences/ui-testing-core.md
主题关键词描述配套文件
测试策略单元测试vs集成测试vsE2E测试、测试替身单元测试、集成测试与E2E测试的决策树,测试替身选择逻辑references/testing-strategy.md
xUnitFacts、Theories、测试夹具、并行执行xUnit v3的Facts、Theories、测试夹具、并行执行、IAsyncLifetimereferences/xunit.md
集成测试WebApplicationFactory、Testcontainers、AspireWebApplicationFactory、Testcontainers、Aspire、数据库测试夹具references/integration-testing.md
快照测试Verify、数据清理、API响应Verify库、数据清理、自定义转换器、HTTP响应快照references/snapshot-testing.md
PlaywrightE2E浏览器测试、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
SlopwatchLLM奖励漏洞检测用于LLM奖励漏洞检测的Slopwatch CLI工具references/slopwatch.md
AOT WASMBlazor/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]