knockoff

Creates reusable .NET test stubs with Return, Call, Verify, and strict mode.

2|Updated Jan 2, 2026
One-click install
npx skills add https://github.com/NeatooDotNet/KnockOff --skill knockoff
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: knockoff
Source: https://github.com/NeatooDotNet/KnockOff/tree/main/skills/knockoff
Command: npx skills add https://github.com/NeatooDotNet/KnockOff --skill knockoff

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

KnockOff simplifies creating reusable test stubs for interfaces and classes in .NET tests.

Core Features & Use Cases

  • Standalone and inline stub patterns for flexible testing across files or within a single test class.
  • Rich interceptor API including Return, Call, When, Verify, Verifiable, Reset, and support for generic, open generic, and delegate patterns.
  • Built-in strict mode, source delegation, and cross-pattern consistency to simplify migration from Moq.

Quick Start

To begin, declare a stub with [KnockOff] (or inline pattern), configure a method to return a value, then exercise the interface and verify via Verify().

Frequently Asked Questions about knockoff

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

FAQPage Schema
How do I create reusable test stubs for .NET unit tests without runtime overhead?

Source generators produce compile-time interceptor code for interfaces and classes, allowing you to create reusable test stubs for .NET unit tests with zero runtime overhead instead of relying on dynamic proxy generation.

What is the best way to migrate from Moq to a source generator mocking framework?

Migrating from Moq is simplified by using a source generator stubbing framework that provides cross-pattern consistency and supports familiar APIs like Return, Call, When, Verify, and Verifiable chains across multiple usage patterns.

Can I configure mock verification and per-test customization for open generic interfaces?

Yes, you can configure mock verification and per-test customization for open generic interfaces using built-in interceptor patterns that support Return, Call, When, Verify, Verifiable, and Reset operations.

Does KnockOff support strict mode and inline class stub patterns in .NET?

KnockOff supports strict mode and inline class stub patterns in .NET, allowing you to define flexible stubs directly within a single test class or as standalone patterns across multiple files.

How do I set up standalone and inline stubs for interface verification in .NET tests?

You set up standalone and inline stubs for interface verification in .NET tests by declaring a stub with an attribute or inline pattern, configuring methods with Return or Call, exercising the interface, and verifying with Verify().

When should I use source delegation for unit test stubs in .NET?

You should use source delegation for unit test stubs in .NET when you need to delegate implementation logic to external source patterns while maintaining consistent verification and zero runtime overhead.