exp-mock-usage-analysis
仓库创建 2026年2月4日最近提交 18 小时前SkillHot 收录 20 天前
▸ 精选理由
有助于精简测试、减少冗余 mock,提高测试可维护性。
这个 Skill 做什么
追踪测试中 Mock 设置的执行路径,找出无用或可替换的 mock。
追踪 .NET 测试中每个 mock 的执行路径,找出未被触发、冗余或可以用真实实现替换的 mock。当你要审计 mock 使用、减少过度 mocking、或评估像 ILogger/IOptions 是否应该用真实现时会用到。支持 Moq、NSubstitute、FakeItEasy,会指出哪些 mock 可以删、合并或改用真实对象。
▸ 展开 SKILL.md 英文原文
Audits .NET test mock usage by tracing each mock setup through the production code's execution path to find dead, unreachable, redundant, or replaceable mocks. Use when the user asks to audit mock usage, find unused or unnecessary mock setups, check if mocks are needed, reduce mock duplication or over-mocking, simplify test setup, or review whether mock configurations like ILogger/IOptions should use real implementations instead. Supports Moq, NSubstitute, and FakeItEasy.
4.8k
Stars
351
Forks
40
仓库内 Skill
+610
7 日增星
安装 / 使用
给你的 Agent 一句话(通用)
帮我安装这个 skill:https://raw.githubusercontent.com/dotnet/skills/main/plugins/dotnet-experimental/skills/exp-mock-usage-analysis/SKILL.md或 curl 直取 SKILL.md
curl -fsSL "https://raw.githubusercontent.com/dotnet/skills/main/plugins/dotnet-experimental/skills/exp-mock-usage-analysis/SKILL.md"SKILL.MD 节选查看完整文件 ↗
# Mock Usage Analysis Trace each mock setup through the production code's execution path to determine which setups are actually exercised at runtime and which are dead, unreachable, redundant, or replaceable with real implementations. ## When to Use - User asks to audit, review, or analyze mock usage in .NET tests - User wants to find unused, unnecessary, or redundant mock setups - User wants to simplify test setup or reduce over-mocking - User asks whether mocks of ILogger, IOptions, or similar types are needed ## When Not to Use - User wants to write new mocks or tests (general testing guidance) - User wants to detect non-mock test anti-patterns (use `test-anti-patterns`) - User wants
via SKILL·HOT · 数据来自 GitHub 公开信息 · 原文版权归作者所有