I have a project I’ve built using the new Rhino.Testing beta
and I have a test loading user data from our plugin
using a 3dm file I’ve persisted
I’m on Rhino version 8.11
the tests pass on my machine…
but not on the machine of my teammates
we have the same rhino version, we’re on the same file versions
the files open as expected when opened directly
but fail to load the user data in the tests on their machines
Userdata can be interpreted only by the plug-in that wrote the data, assuming you’re talking about custom userdata. Make sure that all your team members have the plug-in also installed.
I was talking about custom user data,
the confusing thing is that they can open the files and the user data loads, it just doesn’t find the user data in the tests
Hey @Christina3 do you have some code you can share so I can try to replicate? If you can’t share here I’m happy if you want to DM me some code. We can see if the tests fail on mine, and if so, why
using Microsoft.Win32;
using NUnit.Framework;
using Rhino.Testing.Fixtures;
using System.IO;
namespace TestUtility
{
[SetUpFixture]
public class SetupFixture : RhinoSetupFixture
{
public override void OneTimeSetup()
{
var rhinoDir = Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\McNeel\Rhinoceros\8.0\Install", "Path", null) as string ?? string.Empty;
Assert.True(Directory.Exists(rhinoDir), string.Format("Rhino system dir not found: {0}", rhinoDir));
var xml = $@"<?xml version=""1.0"" encoding=""utf-8""?>
<Settings>
<RhinoSystemDirectory>{rhinoDir}</RhinoSystemDirectory>
</Settings>
";
File.WriteAllText("Rhino.Testing.Configs.xml", xml);
base.OneTimeSetup();
}
public override void OneTimeTearDown()
{
base.OneTimeTearDown();
}
}
}
and that’s the setup fixture
as for the failing test itself
I create a headless rhino document to get my testing data
Coming back to this, I think it may have had something to do with an invalid Plugin instance?
I was able to recreate the issue, and then solve it by building, opening and saving the file before running the test again
You cannot create the “Rhino.Testing.Configs.xml” at the runtime, this because this file won’t be consumed by Rhino’s setup routine. It is too late when you create the config.xml in this OneTimeSetup(). You have to manually create it first and include it in the compiled folder.