moq
✓Mocks dependencies in unit tests using Moq framework. Use when: writing unit tests, creating test doubles for interfaces, verifying method calls, mocking async operations
Installation
SKILL.md
Moq provides type-safe mocking for .NET unit tests. Sorcha uses Moq extensively across 30+ test projects to isolate components and verify interactions. The codebase favors constructor injection with mocks stored as private readonly fields.
| Mock | Create mock instance | new Mock () | | .Object | Get mock instance | mock.Object | | Mock.Of () | Quick mock for simple deps | Mock.Of >() | | Setup() | Configure behavior | .Setup(x => x.Method()) | | ReturnsAsync() | Async return value | .ReturnsAsync(result) | | Callback() | Capture arguments | .Callback ((arg) => captured = arg) |
| Verify() | Assert method called | .Verify(x => x.Method(), Times.Once) | | It.IsAny () | Match any argument | It.IsAny () | | It.Is () | Match with predicate | It.Is (x => x.Id == 1) |
Facts (cite-ready)
Stable fields and commands for AI/search citations.
- Install command
npx skills add https://github.com/stuartf303/sorcha --skill moq- Source
- stuartf303/sorcha
- Category
- </>Dev Tools
- Verified
- ✓
- First Seen
- 2026-02-01
- Updated
- 2026-02-18
Quick answers
What is moq?
Mocks dependencies in unit tests using Moq framework. Use when: writing unit tests, creating test doubles for interfaces, verifying method calls, mocking async operations Source: stuartf303/sorcha.
How do I install moq?
Open your terminal or command line tool (Terminal, iTerm, Windows Terminal, etc.) Copy and run this command: npx skills add https://github.com/stuartf303/sorcha --skill moq Once installed, the skill will be automatically configured in your AI coding environment and ready to use in Claude Code or Cursor
Where is the source repository?
https://github.com/stuartf303/sorcha
Details
- Category
- </>Dev Tools
- Source
- skills.sh
- First Seen
- 2026-02-01