public static void AttachToCurrentTest(this Schema2.ModelRoot model, string fileName) { // find the output path for the current test fileName = NUnit.Framework.TestContext.CurrentContext.GetAttachmentPath(fileName, true); if (fileName.ToLower().EndsWith(".glb")) { model.SaveGLB(fileName); } else if (fileName.ToLower().EndsWith(".gltf")) { model.SaveGLTF(fileName, Newtonsoft.Json.Formatting.Indented); } else if (fileName.ToLower().EndsWith(".obj")) { Schema2.Schema2Toolkit.SaveAsWavefront(model, fileName); } // Attach the saved file to the current test NUnit.Framework.TestContext.AddTestAttachment(fileName); }