‹ 首页

dotnet-verify

@nikiforovall · 收录于 昨天 · 上游提交 3 周前

This skill should be used when working with Verify snapshot tests in .NET projects. Use when updating verified snapshots after intentional code changes, accepting new snapshots, discovering verify tests, or troubleshooting snapshot mismatches. Trigger phrases include "verify tests", "update snapshots", "accept snapshots", "verified files", ".verified.txt".

适合你,如果使用 .NET 项目的 Verify 快照测试并需要管理测试结果。

/ 通过 npx 安装 校验哈希
npx oh-my-skill add nikiforovall/claude-code-rules/dotnet-verify
/ 通过 bash 安装
curl -fsSL https://oh-my-skill.com/install.sh | bash -s -- nikiforovall/claude-code-rules/dotnet-verify
/ 已经装过?验证本机副本,不用重装
npx oh-my-skill verify nikiforovall/claude-code-rules/dotnet-verify
安装目标可用 --agent / --scope 或 --to 明确指定;省略时只会在唯一已存在的 agent 目录上自动选择,零命中或多命中会停止并提示。content_hash 缺失或不一致均拒装。
133GitHub stars
~431上下文体积 · 单文件
索引托管

怎么用

商店整理自技能原文 · 版本 642e21e · 表述以原文为准
它做什么

当您需要管理.NET项目中的Verify快照测试时,Claude可以帮您发现测试文件、更新快照、接受新快照等操作。

什么时候触发

当您提到“verify tests”、“update snapshots”、“accept snapshots”等关键词,或者需要处理.verified.txt文件时触发。

装好后可以这样说
Claude会执行构建、运行测试并接受新快照的流程。
Claude会通过搜索代码库列出相关文件。
技能原文 SKILL.md作者撰写 · Apache-2.0 · 642e21e

.NET Verify Snapshot Testing

Manage Verify snapshot tests using the verify.tool dotnet local tool.

Discovery

To list all test files using Verify snapshots:

rg -l "Verifier\.Verify|UsesVerify|\.verified\." --type cs

To scope to a specific directory:

rg -l "Verifier\.Verify|UsesVerify|\.verified\." --type cs <path/to/test/directory>
Update Snapshots

To update snapshots after intentional code changes:

  1. Build the solution: ```bash dotnet build -p:WarningLevel=0 /clp:ErrorsOnly --verbosity minimal ```
  1. Run affected verify tests (they fail, generating .received. files): ```bash dotnet test <test-project> --no-build --filter "FullyQualifiedName~<TestClass>" -v m ```
  1. Accept all new snapshots: ```bash dotnet verify accept -y ``` To scope to a specific directory: ```bash dotnet verify accept -y -w <path/to/test/directory> ```
  1. Re-run tests to confirm they pass: ```bash dotnet test <test-project> --no-build --filter "FullyQualifiedName~<TestClass>" -v m ```
File Conventions
  • ClassName.MethodName.verified.txt — accepted snapshot (committed to git)
  • ClassName.MethodName.received.txt — latest test output (not committed, gitignored)
  • Parameterized tests: ClassName.MethodName_param=value.verified.txt
Quick Reference

| Command | Purpose | |---|---| | dotnet verify accept -y | Accept all pending snapshots | | dotnet verify accept -y -w <dir> | Accept snapshots in specific directory | | rg -l "Verifier\.Verify\|UsesVerify\|\.verified\." --type cs | List all test files using Verify |

按 Apache-2.0 许可原样转载,未经改动 · 在 GitHub 查看 →

评论

登录即可评论;带「已验证安装」的,是发布者名下有本店的安装或持有记录。