You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: v2/rscg_examples_site/docs/RSCG-Examples/KnockOff.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -87,7 +87,7 @@ public partial class MyRepoStub(List<User> Users) : IMyRepo
87
87
<!-- endSnippet -->
88
88
89
89
-**`[KnockOff]` + `partial class`** — KnockOff generates a base class that implements every member of `IMyRepo`. Your stub is a real class — define it once, reuse it across your entire test project. Pass it around, register it in DI, share it between test fixtures.
90
-
-**Constructor parameters** — `List<User> Users` is a primary constructor. Test data flows in naturally, just like any other C### class.
90
+
-**Constructor parameters** — `List<User> Users` is a primary constructor. Test data flows in naturally, just like any other C# class.
91
91
-**Overrides are optional** — `GetUser_` and `Update_` override the generated defaults. Only override what you need — everything else still works with [Return/Call](https://github.com/NeatooDotNet/KnockOff/docs/guides/methods.md), [Return(value)](https://github.com/NeatooDotNet/KnockOff/docs/reference/interceptor-api.md), or [When chains](https://github.com/NeatooDotNet/KnockOff/docs/guides/parameter-matching.md).
92
92
-**Tighter type safety** — Every Return, Call, and When call is complete in a single step — no forgotten `.Returns()` that [silently breaks at runtime](https://github.com/NeatooDotNet/KnockOff/docs/type-safety.md). No manual `<T1, T2>` type parameters that can drift. [Details →](https://github.com/NeatooDotNet/KnockOff/docs/type-safety.md)
93
93
@@ -178,7 +178,7 @@ myRepoKO.Verify();
178
178
-**[Ref/out parameters](https://github.com/NeatooDotNet/KnockOff/docs/guides/ref-out-parameters.md)** — Natural lambda syntax with `ref`/`out` keywords. No special matchers or index-based access.
179
179
-**[Multiple interfaces](https://github.com/NeatooDotNet/KnockOff/docs/guides/multiple-interfaces.md)** — Unified interceptors on one stub. No `.As<T>()` references or casting.
180
180
-**[Tighter type safety](https://github.com/NeatooDotNet/KnockOff/docs/type-safety.md)** — Each Return/Call/When call is complete in one step — no forgotten `.Returns()` that silently breaks at runtime.
181
-
-**[Parameter matching](https://github.com/NeatooDotNet/KnockOff/docs/guides/parameter-matching-comparison.md)** — `Return((a, b) => a > 0 ? 100 : 0)` — standard C### conditionals instead of `Arg.Is<>` or `It.Is<>` per parameter.
181
+
-**[Parameter matching](https://github.com/NeatooDotNet/KnockOff/docs/guides/parameter-matching-comparison.md)** — `Return((a, b) => a > 0 ? 100 : 0)` — standard C# conditionals instead of `Arg.Is<>` or `It.Is<>` per parameter.
182
182
-**Built-in argument capture** — `LastArg`, `LastArgs`, `LastSetValue`, `LastSetEntry` — no manual `Arg.Do<>` or `Callback<>` setup.
183
183
-**Event verification** — `VerifyAdd()` / `VerifyRemove()` / `HasSubscribers` — not available in Moq or NSubstitute.
184
184
-**Explicit Get/Set verification** — `VerifyGet(Called)` / `VerifySet(Called)` for properties and indexers.
- Moq: `It.IsAny<bool>()` + `.Returns<string, bool>((input, uppercase) => ...)` to match any value and access arguments
477
477
- NSubstitute: `Arg.Any<bool>()` + `x.ArgAt<bool>(1)` to match any value and access arguments
478
-
- KnockOff: `(string input, bool uppercase)` - standard C### lambda with named, typed parameters
478
+
- KnockOff: `(string input, bool uppercase)` - standard C# lambda with named, typed parameters
479
479
480
480
---
481
481
@@ -544,7 +544,7 @@ Source generation turned out to be a great fit for AI code generation. The work
544
544
545
545
######### Claude Code Skill
546
546
547
-
KnockOff includes a [Claude Code skill](skills/knockoff/) that teaches Claude how to use the library. Copy the `skills/knockoff/` directory into your project and Claude Code will know how to create stubs, configure behavior, write tests with KnockOff, and migrate from Moq — without you explaining the API.
547
+
KnockOff includes a [Claude Code skill](https://github.com/NeatooDotNet/KnockOff/skillsknockoff/) that teaches Claude how to use the library. Copy the `skills/knockoff/` directory into your project and Claude Code will know how to create stubs, configure behavior, write tests with KnockOff, and migrate from Moq — without you explaining the API.
548
548
549
549
The skill includes slash commands:
550
550
-**`/knockoff:create-stub`** — Create a new stub class with the pattern of your choice
0 commit comments