RockHopper 1.0.1

dotnet add package RockHopper --version 1.0.1
                    
NuGet\Install-Package RockHopper -Version 1.0.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="RockHopper" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="RockHopper" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="RockHopper" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add RockHopper --version 1.0.1
                    
#r "nuget: RockHopper, 1.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package RockHopper@1.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=RockHopper&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=RockHopper&version=1.0.1
                    
Install as a Cake Tool

RockHopper

Provides a simple way to build a test subject with its mock dependencies. Backed by the Castle Core assembly for proxy generation, this framework supports both constructor and property dependencies.

The mock framework supports strict mocking only. There is no support for loose mocks. This means that you have to provide a matching mock setup for any calls made to mocks. This is by design to enforce deliberate enforcement of good test practices.

Getting Started

For a simple example, you can use your favourite unit test framework and add the following code to test:

public abstract class Calculator
{
    public abstract int Add(int x, int y);
}

public sealed class CalculatorService
{
    private readonly Calculator _calculator;

    public CalculatorService(Calculator calculator)
    {
        _calculator = calculator;
    }

    public int AddNumbers(int x, int y)
    {
        return _calculator.Add(x, y);
    }
}

and then write a test (using XUnit for example):

public class CalculatorServiceTests
{
    [Fact]
    public void TwoNumbers_AddNumbers_ReturnsSum()
    {
        // Arrange
        var calculatorService = TestSubject.Create<CalculatorService>();
        var calculator = calculatorService.GetMock<Calculator>();
        calculator.Function(c => c.Add(1, 2)).Returns(3);
        
        // Act
        var sum = calculatorService.AddNumbers(1, 2);
        
        // Assert
        Assert.Equal(3, sum);
    }
}

More

  1. GitHub for project: https://github.com/hypersolutions/rockhopper/
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.1 144 6/3/2025
1.0.0 150 6/3/2025