Reference Rhino.UI.dll for unit testing of ViewModels

Hello,

Is it possible to reference Rhino.UI during Xunit tests of ViewModels? Headless Rhino.Inside work great for RhinoCommon testing, but I believe it is not a solution for UI library. When I try to reference Rhino.UI with Rhino.Inside I get message:

System.InvalidOperationException : Platform instance is null. Have you created your application?

Best
Łukasz

That error message makes me think you’ll need Rhino open to perform your testing. Rhino.Inside has quite a few limitations when it comes to GUI stuff.

1 Like

Thank you for answer. It turns out I can reference Rhino.UI, without Rhino at all in unit tests. However I was using Eto RelayCommand, which created problems. I assumed it was part of Rhino.UI, but no. I will make some replacement for that.

EDIT: It turn out RelayCommand is ok, just Icon class should not be in view model since it depends on platform implementation I guess.

You can also use the Eto.Forms nuget package if that helps :blush: