Rocks
A mocking library based on the Compiler APIs (Roslyn + Mocks)
Install / Use
/learn @JasonBock/RocksREADME
Rocks

A mocking library based on the Compiler APIs (Roslyn + Mocks).
Getting Started
Reference the Rocks NuGet package - that's it.
Prerequisites
The Rocks package targets .NET Standard 2.0 for host flexibility. That said, Rocks (as of 10.0.0) will generate code that requires .NET 10.
Usage
To make a mock, you take an interface or an unsealed class that has virtual members:
public interface IAmSimple
{
void TargetAction();
}
and you use Rocks to create a mock with expectations, along with verifying its usage:
[assembly: Rock(typeof(IAmSimple), BuildType.Create)]
var expectations = new IAmSimpleCreateExpectations();
expectations.Setups.TargetAction();
var mock = expectations.Instance();
mock.TargetAction();
expectations.Verify();
More details can be found on the Overview page.
Additional Documentation
- Discord Server
- Changelog
- Unit testing best practices with .NET Core and .NET Standard
- BenchmarkMockNet
- Unit Testing CSLA Rules With Rocks
Feedback
If you run into any issues, please add them here.
Related Skills
gh-issues
350.8kFetch GitHub issues, spawn sub-agents to implement fixes and open PRs, then monitor and address PR review comments. Usage: /gh-issues [owner/repo] [--label bug] [--limit 5] [--milestone v1.0] [--assignee @me] [--fork user/repo] [--watch] [--interval 5] [--reviews-only] [--cron] [--dry-run] [--model glm-5] [--notify-channel -1002381931352]
node-connect
350.8kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
110.4kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
Writing Hookify Rules
110.4kThis skill should be used when the user asks to "create a hookify rule", "write a hook rule", "configure hookify", "add a hookify rule", or needs guidance on hookify rule syntax and patterns.
