I am using NUnit for unit testing, but I am having trouble when I try to test objects that use Rhinocommon. I want to run rhino headless (seems like Rhino.Inside is the way to go?) so I can build this into a CICD pipeline.
I’ve been writing a simpler rhino unit testing library for nunit. Here’s a sample.
[RhinoFixture]
public sealed class ExampleTests
{
[TestCase]
public void Brep_Translation()
{
// Arrange
var bb = new BoundingBox(new Point3d(0, 0, 0), new Point3d(100, 100, 100));
var brep = bb.ToBrep();
var t = Transform.Translation(new Vector3d(30, 40, 50));
// Act
brep.Transform(t);
// Assert
Assert.AreEqual(brep.GetBoundingBox(true).Center, new Point3d(80, 90, 100));
}
}