Rocks 8.0.0
See the version list below for details.
dotnet add package Rocks --version 8.0.0
NuGet\Install-Package Rocks -Version 8.0.0
<PackageReference Include="Rocks" Version="8.0.0" />
<PackageVersion Include="Rocks" Version="8.0.0" />
<PackageReference Include="Rocks" />
paket add Rocks --version 8.0.0
#r "nuget: Rocks, 8.0.0"
#:package Rocks@8.0.0
#addin nuget:?package=Rocks&version=8.0.0
#tool nuget:?package=Rocks&version=8.0.0
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. Note that Rocks looks for, and generates, code that targets .NET 8.
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: RockCreate<IAmSimple>]
var expectations = new IAmSimpleCreateExpectations();
expectations.Methods.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
Feedback
If you run into any issues, please add them here.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Rocks:
| Package | Downloads |
|---|---|
|
Stashbox.Rocks
Rocks auto mocking integration for Stashbox. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 10.0.0-alpha.1 | 124 | 9/29/2025 |
| 9.3.0 | 2,131 | 9/15/2025 |
| 9.2.0 | 2,637 | 7/8/2025 |
| 9.1.0 | 1,499 | 5/11/2025 |
| 9.0.2 | 1,489 | 3/18/2025 |
| 9.0.1 | 1,623 | 12/15/2024 |
| 9.0.0 | 342 | 12/4/2024 |
| 9.0.0-alpha.1 | 105 | 10/22/2024 |
| 8.3.1 | 3,901 | 10/2/2024 |
| 8.3.1-alpha.1 | 110 | 9/29/2024 |
| 8.3.0 | 1,417 | 7/24/2024 |
| 8.2.0 | 384 | 7/17/2024 |
| 8.1.0 | 939 | 4/16/2024 |
| 8.0.0 | 700 | 1/22/2024 |
| 8.0.0-alpha.3 | 112 | 1/21/2024 |
| 8.0.0-alpha.2 | 96 | 1/14/2024 |
| 8.0.0-alpha.1 | 139 | 1/13/2024 |
| 7.3.0 | 744 | 11/26/2023 |
| 7.2.0 | 376 | 11/10/2023 |
| 7.1.4 | 425 | 10/7/2023 |
| 7.1.3 | 669 | 7/31/2023 |
| 7.1.2 | 240 | 7/26/2023 |
| 7.1.1 | 325 | 7/17/2023 |
| 7.1.0 | 430 | 7/3/2023 |
| 7.0.1 | 680 | 3/30/2023 |
| 7.0.0 | 1,005 | 11/20/2022 |
| 7.0.0-alpha.3 | 204 | 11/9/2022 |
| 7.0.0-alpha.2 | 212 | 10/10/2022 |
| 7.0.0-alpha.1 | 197 | 9/10/2022 |
| 6.4.5 | 1,258 | 6/29/2022 |
| 6.4.4 | 632 | 6/28/2022 |
| 6.4.3 | 708 | 5/23/2022 |
| 6.4.2 | 591 | 5/22/2022 |
| 6.4.1 | 932 | 4/15/2022 |
| 6.4.0 | 691 | 3/22/2022 |
| 6.3.0 | 6,591 | 11/24/2021 |
| 6.2.0 | 700 | 10/20/2021 |
| 6.0.0 | 751 | 4/12/2021 |
| 5.1.2 | 10,347 | 1/21/2021 |
| 5.1.1 | 630 | 1/21/2021 |
| 5.1.0 | 654 | 12/21/2020 |
| 5.0.0 | 672 | 12/10/2020 |
| 5.0.0-rc3 | 460 | 12/8/2020 |
| 5.0.0-rc2 | 458 | 12/2/2020 |
| 5.0.0-rc1 | 558 | 11/14/2020 |
| 4.2.1 | 851 | 7/25/2020 |
| 4.2.0 | 731 | 7/2/2020 |
| 4.1.1 | 766 | 4/27/2020 |
| 4.1.0 | 799 | 2/26/2020 |
| 4.0.0 | 1,256 | 9/23/2019 |
| 4.0.0-rc.2 | 442 | 8/10/2019 |
| 4.0.0-rc.1 | 445 | 7/18/2019 |
| 3.1.0 | 5,819 | 11/4/2017 |
| 3.0.0 | 3,051 | 8/18/2017 |
| 2.2.0 | 2,909 | 7/6/2017 |
| 2.1.7 | 2,883 | 7/4/2017 |
| 2.1.6 | 2,944 | 7/4/2017 |
| 2.1.5 | 2,898 | 7/4/2017 |
| 2.1.4 | 2,899 | 7/2/2017 |
| 2.1.3 | 2,907 | 7/2/2017 |
| 2.1.2 | 2,848 | 7/1/2017 |
| 2.1.1 | 2,908 | 7/1/2017 |
| 2.1.0 | 3,625 | 5/19/2017 |
| 2.0.0 | 3,963 | 5/1/2017 |
| 2.0.0-beta | 2,566 | 4/30/2017 |
| 1.1.1 | 2,912 | 5/4/2016 |
| 1.0.0 | 2,972 | 1/29/2016 |
| 1.0.0-beta1 | 3,012 | 8/8/2015 |
A changelog is available at https://github.com/JasonBock/Rocks/blob/main/changelog.md