Rhino.Testing 8.0.14-beta

This is a prerelease version of Rhino.Testing.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package Rhino.Testing --version 8.0.14-beta                
NuGet\Install-Package Rhino.Testing -Version 8.0.14-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.14-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.14-beta                
#r "nuget: Rhino.Testing, 8.0.14-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.14-beta&prerelease

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

Rhino.Testing

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:

  <ItemGroup>
    <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" />
  </ItemGroup>

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"?>
<Settings>
  <RhinoSystemDirectory>C:\Program Files\Rhino 8\System</RhinoSystemDirectory>
</Settings>

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

<CreateRhinoDoc>false</CreateRhinoDoc>

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

<CreateRhinoView>false</CreateRhinoView>

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

<LoadEto>true</LoadEto>

<LoadRDK>true</LoadRDK>

Specify Legacy IronPython to be loaded:

<LoadLegacyIronPython>true</LoadLegacyIronPython>

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

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

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

Specify Grasshopper to be loaded:

<LoadGrasshopper>true</LoadGrasshopper>

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

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

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:

[Serializable]
[XmlRoot("Settings")]
public sealed class MyTestSettings
{
    [XmlElement]
    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:

    [SetUpFixture]
    public sealed class SetupFixture : Rhino.Testing.Fixtures.RhinoSetupFixture
    {
        public override void OneTimeSetup()
        {
            base.OneTimeSetup();

            // your custom setup
        }

        public override void OneTimeTearDown()
        {
            base.OneTimeTearDown();

            // you custom teardown
        }
    }

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:

    [TestFixture]
    public sealed class PrimitivesFixture : Rhino.Testing.Fixtures.RhinoTestFixture
    {
        [Test]
        public void YourRhinoTest()
        {
            // you rhino test
        }
    }
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.23-beta 278 9/10/2024
8.0.17-beta 178 6/26/2024
8.0.16-beta 808 5/6/2024
8.0.15-beta 81 5/5/2024
8.0.14-beta 83 4/10/2024
8.0.13-beta 77 4/2/2024
8.0.12-beta 73 3/27/2024
8.0.11-beta 71 3/27/2024
8.0.10-beta 301 3/26/2024
8.0.9-beta 216 2/28/2024
8.0.8-beta 62 2/28/2024
8.0.7-beta 66 2/28/2024
8.0.6-beta 66 2/20/2024
8.0.5-beta 86 2/20/2024
8.0.4-beta 77 2/14/2024
8.0.3-beta 66 2/12/2024
8.0.2-beta 61 2/12/2024
8.0.1-beta 63 2/12/2024
8.0.0-beta 66 2/12/2024