Rhino.Testing 8.0.16-beta

This is a prerelease version of Rhino.Testing.
dotnet add package Rhino.Testing --version 8.0.16-beta
NuGet\Install-Package Rhino.Testing -Version 8.0.16-beta
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="Rhino.Testing" Version="8.0.16-beta" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Rhino.Testing --version 8.0.16-beta
#r "nuget: Rhino.Testing, 8.0.16-beta"
#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.
// Install Rhino.Testing as a Cake Addin
#addin nuget:?package=Rhino.Testing&version=8.0.16-beta&prerelease

// Install Rhino.Testing as a Cake Tool
#tool nuget:?package=Rhino.Testing&version=8.0.16-beta&prerelease


NUnit dotnet unit testing for Rhino3D

Settin Up Your Project

Package References

Add these package references to your project (.csproj). These references ensure your tests are discoverable by the test runner:

    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
    <PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
    <PackageReference Include="NUnit" Version="3.14.0" />
    <PackageReference Include="Rhino.Testing" Version="8.0.10-beta" />

Rhino.Testing Configuration

Rhino.Testing will use Rhino.Testing.Configs.xml file to read RhinoSystemDirectory and setup necessary assembly resolvers for the target Rhino.

<?xml version="1.0" encoding="utf-8"?>
  <RhinoSystemDirectory>C:\Program Files\Rhino 8\System</RhinoSystemDirectory>

When initializing Rhino, an empty headless document is created. You can disable this behaviour:


The default document will be assigned an active view as well. You can disable this behaviour:


Specify Eto or RDK to be loaded (if LoadGrasshopper is specified, Eto and RDK will be automatically loaded):



Specify Legacy IronPython to be loaded:


Specify list of plugins to be loaded (These plugins are always loaded before Grasshopper)

    <Plugin Location="Plug-ins\IronPython\RhinoDLR_Python.rhp" />

    <Plugin Location="MyPlugins\MyRhinoPlugin.rhp" />

Specify Grasshopper to be loaded:


Make sure this file is copied onto the build folder (where Rhino.Testing.dll exists):

    <None Update="Rhino.Testing.Configs.xml" CopyToOutputDirectory="always" />

Rhino.Testing.Configs.xml can also contains any other configuration you want for your project. You can deserialize the xml file into your own settings:

public sealed class MyTestSettings
    public string MySetting { get; set; }

// use the default settings file (or your own xml file)
string settingsFile = Rhino.Testing.Configs.SettingsFile;

// create an xml serializer for your settings type
XmlSerializer serializer = new XmlSerializer(typeof(MyTestSettings));

// deserialize your settings
var settings = Rhino.Testing.Configs.Deserialize<MyTestSettings>(serializer, settingsFile);

Setup Fixture

Implement the Rhino.Testing.Fixtures.RhinoSetupFixture abstract class in your test library to setup and teardown your testing fixture:

    public sealed class SetupFixture : Rhino.Testing.Fixtures.RhinoSetupFixture
        public override void OneTimeSetup()

            // your custom setup

        public override void OneTimeTearDown()

            // you custom teardown

Loading GHAs for Testing

If your tests required a Grasshopper definition to be loaded, you can use RhinoSetupFixture.LoadGHA(IEnumerable<string> ghaPaths) method:

    public sealed class SetupFixture : Rhino.Testing.Fixtures.RhinoSetupFixture
        public override void OneTimeSetup()

            LoadGHA(new string[] {

These GH plugins will be loaded during startup.

Test Fixture

Implement the Rhino.Testing.Fixtures.RhinoTestFixture abstract class in your test library, add methods for each of your test and make sure to add the [Test] attribute to these methods:

    public sealed class PrimitivesFixture : Rhino.Testing.Fixtures.RhinoTestFixture
        public void YourRhinoTest()
            // you rhino test

Testing Grasshopper Files

You can run Grasshopper definitions as tests. If definition contains a Context Bake component that is named result, the data structure in that definition is checked for GH_Boolean values and the result is returned.

Notice the Context Bake component at the right side of this definition:

alternate text is missing from this package README image

This is how the fixture would run the definition:

    public sealed class PrimitivesFixture : Rhino.Testing.Fixtures.RhinoTestFixture
        public void TestCircle()
            const string ghFilePath = @"Files\circle.gh";

            RhinoTestFixture.TestGrasshopper(ghFilePath, out bool result, out GHReport report);
            // check if result is true

            // and report has no errors

The GHReport data structure contains any component messages after definition is solved.

Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  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.  net7.0-windows7.0 is compatible.  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. 
.NET Framework net48 is compatible.  net481 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
8.0.16-beta 61 5/6/2024
8.0.15-beta 61 5/5/2024
8.0.14-beta 65 4/10/2024
8.0.13-beta 59 4/2/2024
8.0.12-beta 59 3/27/2024
8.0.11-beta 59 3/27/2024
8.0.10-beta 116 3/26/2024
8.0.9-beta 171 2/28/2024
8.0.8-beta 51 2/28/2024
8.0.7-beta 54 2/28/2024
8.0.6-beta 53 2/20/2024
8.0.5-beta 76 2/20/2024
8.0.4-beta 63 2/14/2024
8.0.3-beta 53 2/12/2024
8.0.2-beta 49 2/12/2024
8.0.1-beta 43 2/12/2024
8.0.0-beta 52 2/12/2024