关于 dotnet-testing
dotnet-testing 是面向 .NET 应用测试规划与实施的技能。它按主题整理测试策略、xUnit、集成与浏览器测试、基准测试、覆盖率、变异测试和 UI 测试模式。
主要功能
- 01单元、集成和 E2E 测试策略
- 02xUnit v3 编写指导
- 03集成测试与 Playwright 测试
- 04基准测试与 CI 回归检查
- 05覆盖率、变异测试和不稳定测试指导
- 06跨框架 UI 测试模式
适用场景
- 01选择测试类型和测试替身
- 02为项目添加 xUnit 测试
- 03测试 API 和浏览器工作流
- 04跟踪性能与测试质量
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ novotnyllc/ dotnet-artisan --skill dotnet-testing安装后在 Claude Code 中输入/dotnet-testing确认已加载。
包含的文件
除 SKILL.md 外,安装时一起下载的参考资料和脚本。
agents/openai.yamlreferences/add-testing.mdaot-wasm.mdaspire-testing.mdbenchmarkdotnet.mdci-benchmarking.mdintegration-testing.mdplaywright.mdslopwatch.mdsnapshot-testing.mdtest-quality.mdtesting-strategy.mdui-testing-core.mdxunit.md详细介绍
dotnet-testing
概述
.NET 应用的测试策略、框架和质量工具。此整合技能涵盖 13 个主题领域。请根据下方的路由表,从 references/ 加载适当的配套文件。
基准依赖项:references/testing-strategy.md 定义了单元测试、集成测试和 E2E 测试之间的决策树,以及影响所有测试决策的测试替身选择。每当需要选择测试方法时,默认加载此文件。
共享最多的配套文件:references/xunit.md 涵盖了集成测试、快照测试和 UI 测试配套文件中使用的 xUnit v3 框架功能。
路由表
| 主题 | 关键词 | 描述 | 配套文件 |
|---|---|---|---|
| 策略 | 单元测试 vs 集成测试 vs E2E、测试替身 | 单元测试、集成测试和 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 | 大模型奖励作弊检测 | 用于检测大模型奖励作弊的 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 |
| Aspire 测试 | DistributedApplicationTestingBuilder、Aspire 测试主机 | Aspire 测试主机、服务 HTTP 客户端、资源运行状况 | references/aspire-testing.md |
范围
- 测试策略和架构(单元测试、集成测试、E2E)
- 编写 xUnit v3 测试
- 集成测试(WebApplicationFactory、Testcontainers)
- E2E 浏览器测试(Playwright)
- 快照测试(Verify)
- 基准测试(BenchmarkDotNet、CI 门禁)
- 质量(覆盖率、变异测试)
- 跨框架 UI 测试模式
- 测试脚手架
不在范围内
- UI 框架专属测试(bUnit、Appium)->
dotnet-ui - CI/CD 流水线配置 ->
dotnet-devops - 性能分析 ->
dotnet-tooling
评论
支持 Markdown