I’m writing a set of grasshopper components in Visual Studio 2017, and I have a collection of unit tests (set up with Tom Makin’s solution here) that have been working well.
Any time I try to run tests that involve Curve.Offset(), though, it throws my favorite error: “Object reference not set to an instance of an object.” I spent some time yesterday debugging the problem and am pretty sure it’s this specific method, and all of its versions.
For reference, I’m testing a slightly reformatted version of this older grasshopper component (which uses Curve.Offset() just fine). Lines 50 & 51 are the troublemakers in the new project’s tests.
This is my first time unit testing, and some searching brought up references to threading, which I’m not completely proficient in. Is this issue a limitation of certain RhinoCommon methods, or is it something I’m just approaching the wrong way?
Error was thrown when
Curve.Offset() was called (or similar selection). But Curve.Offset returns
null, explained below.