exp-mock-usage-analysis

Analyze .NET test mock usage for dead, unreachable, redundant, or replaceable mocks.

Updated May 28, 2026
One-click install
npx skills add https://github.com/ojrojas/AgentsInstructions --skill exp-mock-usage-analysis
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: exp-mock-usage-analysis
Source: https://github.com/ojrojas/AgentsInstructions/tree/main/.claude/skills/dotnet-experimental/skills/exp-mock-usage-analysis
Command: npx skills add https://github.com/ojrojas/AgentsInstructions --skill exp-mock-usage-analysis

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill helps identify and rectify issues in .NET test mock usage, such as dead, unreachable, redundant, or replaceable mocks, improving test quality and efficiency.

Core Features & Use Cases

  • Mock Usage Audit: Trace and analyze mock setups to find dead, unreachable, redundant, or replaceable mocks.
  • Mock Framework Support: Supports Moq, NSubstitute, and FakeItEasy.
  • Use Case: When reviewing .NET test code and wanting to ensure mocks are used effectively, without over-mocking or unnecessary complexity.

Quick Start

Analyze the mock usage in your .NET tests by providing the test code and production code for analysis.

Frequently Asked Questions about exp-mock-usage-analysis

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find dead or redundant mocks in my .NET test code?

To find dead or redundant mocks in .NET test code, you can analyze your mock setups to trace usage and identify unreachable or replaceable configurations. This process ensures mocks are used effectively without unnecessary complexity.

Does mock analysis work with NSubstitute and FakeItEasy, or just Moq?

Mock analysis works with Moq, NSubstitute, and FakeItEasy. You can audit mock usage across these three frameworks to identify replaceable or redundant setups and improve overall test efficiency.

How do I audit mock usage to improve .NET test quality?

You audit mock usage by providing your .NET test code and production code for analysis. The audit traces mock setups to locate dead, unreachable, redundant, or replaceable mocks, directly improving test quality and efficiency.

When should I analyze mock usage in my .NET tests?

You should analyze mock usage when reviewing .NET test code to ensure mocks are used effectively. It helps rectify issues like over-mocking and unnecessary complexity by identifying dead, unreachable, or redundant mock configurations.

What is a replaceable mock in .NET test optimization?

A replaceable mock in .NET test optimization is a setup that adds unnecessary complexity and can be substituted or removed. Identifying replaceable mocks alongside dead and unreachable ones streamlines tests and improves efficiency.