Browse Source

updated test attachment utils

Vicente Penades 3 years ago
parent
commit
5035306ea8
24 changed files with 134 additions and 244 deletions
  1. 1 1
      tests/SharpGLTF.Core.Tests/Animations/AnimationSamplingTests.cs
  2. 0 6
      tests/SharpGLTF.Core.Tests/AssemblyAPITests.cs
  3. 0 1
      tests/SharpGLTF.Core.Tests/IO/JsonContentTests.cs
  4. 1 1
      tests/SharpGLTF.Core.Tests/Properties/AssemblyInfo.cs
  5. 1 1
      tests/SharpGLTF.Core.Tests/Runtime/SceneTemplateTests.cs
  6. 4 8
      tests/SharpGLTF.Core.Tests/Schema2/Authoring/BasicSceneCreationTests.cs
  7. 7 14
      tests/SharpGLTF.Core.Tests/Schema2/Authoring/ExtensionsCreationTests.cs
  8. 1 3
      tests/SharpGLTF.Core.Tests/Schema2/LoadAndSave/LoadGeneratedTests.cs
  9. 1 1
      tests/SharpGLTF.Core.Tests/Schema2/LoadAndSave/LoadInvalidTests.cs
  10. 5 18
      tests/SharpGLTF.Core.Tests/Schema2/LoadAndSave/LoadSampleTests.cs
  11. 3 19
      tests/SharpGLTF.Core.Tests/Schema2/LoadAndSave/LoadSpecialModelsTest.cs
  12. 1 1
      tests/SharpGLTF.Core.Tests/Schema2/LoadAndSave/RegressionTests.cs
  13. 8 8
      tests/SharpGLTF.NUnit/NUnitGltfUtils.cs
  14. 1 35
      tests/SharpGLTF.NUnit/NUnitUtils.cs
  15. 2 2
      tests/SharpGLTF.NUnit/Plotting.cs
  16. 1 1
      tests/SharpGLTF.NUnit/SharpGLTF.NUnit.csproj
  17. 7 7
      tests/SharpGLTF.ThirdParty.Tests/AceCebovTests.cs
  18. 59 59
      tests/SharpGLTF.ThirdParty.Tests/EdMackeyTests.cs
  19. 4 6
      tests/SharpGLTF.ThirdParty.Tests/PetarTasevTests.cs
  20. 3 5
      tests/SharpGLTF.ThirdParty.Tests/SandboxTests.cs
  21. 1 1
      tests/SharpGLTF.ThirdParty.Tests/SharpGLTF.ThirdParty.Tests.csproj
  22. 8 16
      tests/SharpGLTF.Toolkit.Tests/Geometry/MeshBuilderAdvancedTests.cs
  23. 1 2
      tests/SharpGLTF.Toolkit.Tests/Materials/ContentSharingTests.cs
  24. 14 28
      tests/SharpGLTF.Toolkit.Tests/Scenes/SceneBuilderTests.cs

+ 1 - 1
tests/SharpGLTF.Core.Tests/Animations/AnimationSamplingTests.cs

@@ -9,7 +9,7 @@ using NUnit.Framework;
 namespace SharpGLTF
 {
     [TestFixture]
-    [AttachmentPathFormat("*/TestResults/Animations/?")]
+    [AttachmentPathFormat("*/TestResults/Animations/?", true)]
     [Category("Core.Animations")]
     public class AnimationSamplingTests
     {

+ 0 - 6
tests/SharpGLTF.Core.Tests/AssemblyAPITests.cs

@@ -50,8 +50,6 @@ namespace SharpGLTF
         [Test(Description = "proof of concept to dump the whole public API of an assembly")]
         public void DumpTestAPI()
         {
-            TestContext.CurrentContext.AttachShowDirLink();
-
             var type = typeof(TestClass);
 
             var API = DumpAssemblyAPI.GetTypeSignature(type.GetTypeInfo()).OrderBy(item => item).ToArray();
@@ -68,8 +66,6 @@ namespace SharpGLTF
         [Test(Description ="Checks if we have introduced a breaking change between the current and previous API")]
         public void DumpCoreAPI()
         {
-            TestContext.CurrentContext.AttachShowDirLink();
-
             var assembly = typeof(Schema2.ModelRoot).Assembly;
 
             var API = DumpAssemblyAPI
@@ -87,8 +83,6 @@ namespace SharpGLTF
         [Test(Description = "Checks if we have introduced a breaking change between the current and previous API")]
         public void DumpToolkitAPI()
         {
-            TestContext.CurrentContext.AttachShowDirLink();
-
             var assembly = typeof(Schema2.Toolkit).Assembly;
 
             var API = DumpAssemblyAPI

+ 0 - 1
tests/SharpGLTF.Core.Tests/IO/JsonContentTests.cs

@@ -216,7 +216,6 @@ namespace SharpGLTF.IO
         [Test]
         public void TestJsonExtendedCharacters()
         {
-            TestContext.CurrentContext.AttachShowDirLink();
             TestContext.CurrentContext.AttachGltfValidatorLinks();
 
             // create a test model

+ 1 - 1
tests/SharpGLTF.Core.Tests/Properties/AssemblyInfo.cs

@@ -7,4 +7,4 @@ using System.Threading.Tasks;
 using NUnit.Framework;
 
 [assembly: ResourcePathFormat("*/Assets")]
-[assembly: AttachmentPathFormat("*/TestResults/?")]
+[assembly: AttachmentPathFormat("*/TestResults/?", true)]

+ 1 - 1
tests/SharpGLTF.Core.Tests/Runtime/SceneTemplateTests.cs

@@ -11,7 +11,7 @@ using Plotly;
 namespace SharpGLTF.Runtime
 {
     [Category("Core.Runtime")]
-    [AttachmentPathFormat("*/TestResults/Runtime/?")]
+    [AttachmentPathFormat("*/TestResults/Runtime/?", true)]
     public class SceneTemplateTests
     {
         [Test]

+ 4 - 8
tests/SharpGLTF.Core.Tests/Schema2/Authoring/BasicSceneCreationTests.cs

@@ -70,8 +70,7 @@ namespace SharpGLTF.Schema2.Authoring
 
         [Test(Description = "Creates a model with a triangle mesh")]
         public void CreateSceneWithSolidTriangle()
-        {
-            TestContext.CurrentContext.AttachShowDirLink();
+        {            
             TestContext.CurrentContext.AttachGltfValidatorLinks();
 
             // create model
@@ -114,8 +113,7 @@ namespace SharpGLTF.Schema2.Authoring
 
         [Test(Description = "Creates a model with a textured triangle mesh")]
         public void CreateSceneWithTexturedTriangle()
-        {
-            TestContext.CurrentContext.AttachShowDirLink();
+        {            
             TestContext.CurrentContext.AttachGltfValidatorLinks();
 
             // we'll use our icon as the source texture
@@ -161,8 +159,7 @@ namespace SharpGLTF.Schema2.Authoring
 
         [Test(Description = "Creates an interleaved scene using a toolkit utilities")]
         public void CreateSceneWithInterleavedQuadMesh()
-        {
-            TestContext.CurrentContext.AttachShowDirLink();
+        {            
             TestContext.CurrentContext.AttachGltfValidatorLinks();
 
             var vertices = new[]
@@ -191,8 +188,7 @@ namespace SharpGLTF.Schema2.Authoring
 
         [Test(Description = "Creates a scene with a perspective camera")]
         public void CreateSceneWithCamera()
-        {
-            TestContext.CurrentContext.AttachShowDirLink();
+        {            
             TestContext.CurrentContext.AttachGltfValidatorLinks();
             
             var model = ModelRoot.CreateModel();

+ 7 - 14
tests/SharpGLTF.Core.Tests/Schema2/Authoring/ExtensionsCreationTests.cs

@@ -23,8 +23,7 @@ namespace SharpGLTF.Schema2.Authoring
 
         [Test(Description = "Creates a scene with lights")]
         public void CreateSceneWithWithLightsExtension()
-        {
-            TestContext.CurrentContext.AttachShowDirLink();
+        {            
             TestContext.CurrentContext.AttachGltfValidatorLinks();
 
             var root = ModelRoot.CreateModel();
@@ -45,8 +44,7 @@ namespace SharpGLTF.Schema2.Authoring
 
         [Test(Description = "Creates a quad mesh with a complex material")]
         public void CreateSceneWithSpecularGlossinessExtension()
-        {
-            TestContext.CurrentContext.AttachShowDirLink();
+        {            
             TestContext.CurrentContext.AttachGltfValidatorLinks();
 
             var basePath = System.IO.Path.Combine(TestFiles.KhronosSampleModelsDirectory, "2.0", "SpecGlossVsMetalRough", "glTF");
@@ -87,8 +85,7 @@ namespace SharpGLTF.Schema2.Authoring
 
         [Test(Description = "Creates a quad mesh with a complex material")]
         public void CreateSceneWithClearCoatExtension()
-        {
-            TestContext.CurrentContext.AttachShowDirLink();
+        {            
             TestContext.CurrentContext.AttachGltfValidatorLinks();
 
             var basePath = System.IO.Path.Combine(TestFiles.KhronosSampleModelsDirectory, "2.0", "SpecGlossVsMetalRough", "glTF");
@@ -127,8 +124,7 @@ namespace SharpGLTF.Schema2.Authoring
 
         [Test(Description = "Creates a quad mesh with a complex material")]
         public void CreateSceneWithTransmissionExtension()
-        {
-            TestContext.CurrentContext.AttachShowDirLink();
+        {            
             TestContext.CurrentContext.AttachGltfValidatorLinks();
 
             var basePath = System.IO.Path.Combine(TestFiles.KhronosSampleModelsDirectory, "2.0", "SpecGlossVsMetalRough", "glTF");
@@ -164,8 +160,7 @@ namespace SharpGLTF.Schema2.Authoring
 
         [Test(Description = "Creates a quad mesh with a complex material")]
         public void CreateSceneWithsSheenExtension()
-        {
-            TestContext.CurrentContext.AttachShowDirLink();
+        {            
             TestContext.CurrentContext.AttachGltfValidatorLinks();
 
             var basePath = System.IO.Path.Combine(TestFiles.KhronosSampleModelsDirectory, "2.0", "SpecGlossVsMetalRough", "glTF");
@@ -208,8 +203,7 @@ namespace SharpGLTF.Schema2.Authoring
         [TestCase("shannon.webp")]
         [TestCase("FlightHelmet_baseColor_basis.ktx2")]
         public void CreateSceneWithTextureImageExtension(string textureFileName)
-        {
-            TestContext.CurrentContext.AttachShowDirLink();
+        {            
             TestContext.CurrentContext.AttachGltfValidatorLinks();
 
             var basePath = System.IO.Path.Combine(TestContext.CurrentContext.WorkDirectory, "Assets");
@@ -250,8 +244,7 @@ namespace SharpGLTF.Schema2.Authoring
 
         [Test]
         public void CrateSceneWithTextureTransformExtension()
-        {
-            TestContext.CurrentContext.AttachShowDirLink();
+        {            
             TestContext.CurrentContext.AttachGltfValidatorLinks();
 
             var basePath = System.IO.Path.Combine(TestContext.CurrentContext.WorkDirectory, "Assets");

+ 1 - 3
tests/SharpGLTF.Core.Tests/Schema2/LoadAndSave/LoadGeneratedTests.cs

@@ -11,7 +11,7 @@ namespace SharpGLTF.Schema2.LoadAndSave
     /// Test cases for models found in <see href="https://github.com/bghgary/glTF-Asset-Generator"/>
     /// </summary>
     [TestFixture]    
-    [AttachmentPathFormat("*/TestResults/LoadAndSave/?")]
+    [AttachmentPathFormat("*/TestResults/LoadAndSave/?", true)]
     [Category("Model Load and Save")]
     public class LoadGeneratedTests
     {
@@ -29,8 +29,6 @@ namespace SharpGLTF.Schema2.LoadAndSave
         [TestCase(false)]
         public void LoadGeneratedModels(bool isNegativeCase)
         {
-            TestContext.CurrentContext.AttachShowDirLink();
-
             var files = TestFiles.GetReferenceModelPaths(isNegativeCase);
 
             bool passed = true;

+ 1 - 1
tests/SharpGLTF.Core.Tests/Schema2/LoadAndSave/LoadInvalidTests.cs

@@ -7,7 +7,7 @@ using NUnit.Framework;
 namespace SharpGLTF.Schema2.LoadAndSave
 {
     [TestFixture]
-    [AttachmentPathFormat("*/TestResults/LoadAndSave/?")]
+    [AttachmentPathFormat("*/TestResults/LoadAndSave/?", true)]
     [Category("Model Load and Save")]
     public class LoadInvalidTests
     {

+ 5 - 18
tests/SharpGLTF.Core.Tests/Schema2/LoadAndSave/LoadSampleTests.cs

@@ -11,7 +11,7 @@ namespace SharpGLTF.Schema2.LoadAndSave
     /// Test cases for models found in <see href="https://github.com/KhronosGroup/glTF-Sample-Models"/> and more....
     /// </summary>
     [TestFixture]
-    [AttachmentPathFormat("*/TestResults/LoadAndSave/?")]
+    [AttachmentPathFormat("*/TestResults/LoadAndSave/?", true)]
     [Category("Model Load and Save")]
     public class LoadSampleTests
     {
@@ -99,8 +99,7 @@ namespace SharpGLTF.Schema2.LoadAndSave
         // [TestCase("\\glTF-Quantized\\")] // removed from tests
         // [TestCase("\\glTF-pbrSpecularGlossiness\\")] // removed from tests
         public void LoadModelsFromKhronosSamples(string section)
-        {
-            TestContext.CurrentContext.AttachShowDirLink();
+        {            
             TestContext.CurrentContext.AttachGltfValidatorLinks();
 
             foreach (var f in TestFiles.GetSampleModelsPaths())
@@ -113,8 +112,7 @@ namespace SharpGLTF.Schema2.LoadAndSave
 
         [Test]
         public void LoadModelsFromBabylonJs()
-        {
-            TestContext.CurrentContext.AttachShowDirLink();
+        {         
             TestContext.CurrentContext.AttachGltfValidatorLinks();
 
             foreach (var f in TestFiles.GetBabylonJSModelsPaths())
@@ -127,8 +125,7 @@ namespace SharpGLTF.Schema2.LoadAndSave
         [TestCase("GrassFieldInstanced.glb")]
         [TestCase("InstanceTest.glb")]
         public void LoadModelsWithGpuMeshInstancingExtension(string fileFilter)
-        {
-            TestContext.CurrentContext.AttachShowDirLink();
+        {            
             TestContext.CurrentContext.AttachGltfValidatorLinks();
 
             var f = TestFiles.GetMeshIntancingModelPaths().FirstOrDefault(item => item.Contains(fileFilter));
@@ -174,8 +171,7 @@ namespace SharpGLTF.Schema2.LoadAndSave
         [TestCase(@"glTF-Quantized\Lantern.gltf")]
         [TestCase(@"MosquitoInAmber.glb")]
         public void LoadModelsWithExtensions(string filePath)
-        {
-            TestContext.CurrentContext.AttachShowDirLink();
+        {            
             TestContext.CurrentContext.AttachGltfValidatorLinks();
 
             filePath = TestFiles
@@ -253,8 +249,6 @@ namespace SharpGLTF.Schema2.LoadAndSave
         [Test]
         public void LoadModelWithMorphTargets()
         {
-            TestContext.CurrentContext.AttachShowDirLink();
-
             var path = TestFiles
                 .GetSampleModelsPaths()
                 .FirstOrDefault(item => item.Contains("MorphPrimitivesTest.glb"));
@@ -281,8 +275,6 @@ namespace SharpGLTF.Schema2.LoadAndSave
         [TestCase("Fox.glb")]
         public void LoadModelsWithAnimations(string path)
         {
-            TestContext.CurrentContext.AttachShowDirLink();
-
             path = TestFiles
                 .GetSampleModelsPaths()
                 .FirstOrDefault(item => item.Contains(path));
@@ -313,8 +305,6 @@ namespace SharpGLTF.Schema2.LoadAndSave
         [Test]
         public void LoadAnimatedMorphCube()
         {
-            TestContext.CurrentContext.AttachShowDirLink();
-
             var path = TestFiles
                 .GetSampleModelsPaths()
                 .FirstOrDefault(item => item.Contains("AnimatedMorphCube.glb"));
@@ -386,8 +376,6 @@ namespace SharpGLTF.Schema2.LoadAndSave
         [Test]
         public void LoadMultiUVTexture()
         {
-            TestContext.CurrentContext.AttachShowDirLink();
-
             var path = TestFiles
                 .GetSampleModelsPaths()
                 .FirstOrDefault(item => item.Contains("TextureTransformMultiTest.glb"));
@@ -407,7 +395,6 @@ namespace SharpGLTF.Schema2.LoadAndSave
         [Test]
         public void FindDependencyFiles()
         {
-            TestContext.CurrentContext.AttachShowDirLink();
             TestContext.CurrentContext.AttachGltfValidatorLinks();
 
             foreach (var f in TestFiles.GetBabylonJSModelsPaths())

+ 3 - 19
tests/SharpGLTF.Core.Tests/Schema2/LoadAndSave/LoadSpecialModelsTest.cs

@@ -12,7 +12,7 @@ namespace SharpGLTF.Schema2.LoadAndSave
     /// Test cases for models found in <see href="https://github.com/KhronosGroup/glTF-Blender-Exporter"/>
     /// </summary>
     [TestFixture]
-    [AttachmentPathFormat("*/TestResults/LoadAndSave/?")]
+    [AttachmentPathFormat("*/TestResults/LoadAndSave/?", true)]
     [Category("Model Load and Save")]
     public class LoadSpecialModelsTest
     {
@@ -29,8 +29,6 @@ namespace SharpGLTF.Schema2.LoadAndSave
         [Test]
         public void LoadEscapedUriModel()
         {
-            TestContext.CurrentContext.AttachShowDirLink();
-
             var path = System.IO.Path.Combine(TestContext.CurrentContext.TestDirectory, "Assets\\white space.gltf");
 
             var model = ModelRoot.Load(path);
@@ -41,8 +39,6 @@ namespace SharpGLTF.Schema2.LoadAndSave
 
         public void LoadWithCustomImageLoader()
         {
-            TestContext.CurrentContext.AttachShowDirLink();            
-
             // load Polly model
             var model = ModelRoot.Load(TestFiles.GetPollyFileModelPath());
         }
@@ -50,8 +46,6 @@ namespace SharpGLTF.Schema2.LoadAndSave
         [Test(Description = "Example of traversing the visual tree all the way to individual vertices and indices")]
         public void LoadPollyModel()
         {
-            TestContext.CurrentContext.AttachShowDirLink();
-
             // load Polly model
             var model = ModelRoot.Load(TestFiles.GetPollyFileModelPath(), Validation.ValidationMode.TryFix);
 
@@ -117,8 +111,6 @@ namespace SharpGLTF.Schema2.LoadAndSave
         [Test]
         public void LoadUniVRM()
         {
-            TestContext.CurrentContext.AttachShowDirLink();
-
             var path = TestFiles.GetUniVRMModelPath();
             
             var model = ModelRoot.Load(path);
@@ -132,8 +124,6 @@ namespace SharpGLTF.Schema2.LoadAndSave
         // [Test]
         public void LoadShrekshaoModel()
         {
-            TestContext.CurrentContext.AttachShowDirLink();
-
             var path = "Assets\\SpecialCases\\shrekshao.glb";
 
             var model = ModelRoot.Load(path);
@@ -144,9 +134,7 @@ namespace SharpGLTF.Schema2.LoadAndSave
         public void LoadMouseModel()
         {
             // this model has several nodes with curve animations containing a single animation key,
-            // which is causing some problems to the interpolator.
-
-            TestContext.CurrentContext.AttachShowDirLink();
+            // which is causing some problems to the interpolator.            
             
             var path = System.IO.Path.Combine(TestContext.CurrentContext.TestDirectory, "Assets\\SpecialCases\\mouse.glb");
 
@@ -173,9 +161,7 @@ namespace SharpGLTF.Schema2.LoadAndSave
         public void LoadSketchfabModels(string path)
         {
             // this model has several nodes with curve animations containing a single animation key,
-            // which is causing some problems to the interpolator.
-
-            TestContext.CurrentContext.AttachShowDirLink();
+            // which is causing some problems to the interpolator.            
 
             path = System.IO.Path.Combine(TestContext.CurrentContext.TestDirectory, $"Assets\\SpecialCases\\{path}");
 
@@ -190,8 +176,6 @@ namespace SharpGLTF.Schema2.LoadAndSave
         [TestCase("NormalTangentMirrorTest.glb")]
         public void LoadGeneratedTangetsTest(string fileName)
         {
-            TestContext.CurrentContext.AttachShowDirLink();
-
             var path = TestFiles.GetSampleModelsPaths().FirstOrDefault(item => item.EndsWith(fileName));
 
             var model = ModelRoot.Load(path);

+ 1 - 1
tests/SharpGLTF.Core.Tests/Schema2/LoadAndSave/RegressionTests.cs

@@ -10,7 +10,7 @@ using SharpGLTF.Validation;
 
 namespace SharpGLTF.Schema2.LoadAndSave
 {
-    [AttachmentPathFormat("*/TestResults/LoadAndSave/?")]
+    [AttachmentPathFormat("*/TestResults/LoadAndSave/?", true)]
     internal class RegressionTests
     {
         [Test]

+ 8 - 8
tests/SharpGLTF.NUnit/NUnitGltfUtils.cs

@@ -14,10 +14,10 @@ namespace SharpGLTF
     {
         public static void AttachGltfValidatorLinks(this TestContext context)
         {
-            context.AttachLink("🌍 Khronos Validator", "http://github.khronos.org/glTF-Validator/");
-            context.AttachLink("🌍 BabylonJS Sandbox", "https://sandbox.babylonjs.com/");
-            context.AttachLink("🌍 Don McCurdy Sandbox", "https://gltf-viewer.donmccurdy.com/");
-            context.AttachLink("🌍 VirtualGIS Cesium Sandbox", "https://www.virtualgis.io/gltfviewer/");
+            // new AttachmentInfo(context, "🌍 Khronos Validator.lnk").WriteLink("http://github.khronos.org/glTF-Validator/");
+            // new AttachmentInfo(context, "🌍 BabylonJS Sandbox.lnk").WriteLink("https://sandbox.babylonjs.com/");
+            // new AttachmentInfo(context, "🌍 Don McCurdy Sandbox.lnk").WriteLink("https://gltf-viewer.donmccurdy.com/");
+            // new AttachmentInfo(context, "🌍 VirtualGIS Cesium Sandbox.lnk").WriteLink("https://www.virtualgis.io/gltfviewer/");
         }        
 
         public static void AttachToCurrentTest(this Scenes.SceneBuilder scene, string fileName)
@@ -35,7 +35,7 @@ namespace SharpGLTF
 
             AttachmentInfo
                 .From(fileName)
-                .WriteFile(f => model.SaveAsWavefront(f.FullName, animation, time));
+                .WriteObject(f => model.SaveAsWavefront(f.FullName, animation, time));
         }
 
         public static string AttachToCurrentTest<TvG, TvM, TvS>(this Geometry.MeshBuilder<TvG, TvM, TvS> mesh, string fileName)
@@ -61,7 +61,7 @@ namespace SharpGLTF
             {
                 validationPath = fileName = AttachmentInfo
                     .From(fileName)
-                    .WriteFile(f => model.SaveGLB(f.FullName, settings))
+                    .WriteObject(f => model.SaveGLB(f.FullName, settings))
                     .FullName;
             }
             else if (fileName.ToLowerInvariant().EndsWith(".gltf"))
@@ -70,7 +70,7 @@ namespace SharpGLTF
 
                 validationPath = fileName = AttachmentInfo
                     .From(fileName)
-                    .WriteFile(f => model.Save(f.FullName, settings))
+                    .WriteObject(f => model.Save(f.FullName, settings))
                     .FullName;
             }
             else if (fileName.ToLowerInvariant().EndsWith(".obj"))
@@ -82,7 +82,7 @@ namespace SharpGLTF
 
                 fileName = AttachmentInfo
                     .From(fileName)
-                    .WriteFile(f => model.SaveAsWavefront(f.FullName))
+                    .WriteObject(f => model.SaveAsWavefront(f.FullName))
                     .FullName;
             }
             else if (fileName.ToLowerInvariant().EndsWith(".plotly"))

+ 1 - 35
tests/SharpGLTF.NUnit/NUnitUtils.cs

@@ -22,40 +22,6 @@ namespace SharpGLTF
             }
 
             return System.IO.Path.Combine(dir, fxt);
-        }
-
-        public static string GetAttachmentPath(this TestContext context, string fileName, bool ensureDirectoryExists = false)
-        {
-            var path = System.IO.Path.Combine(context.TestDirectory, "TestResults", $"{context.Test.ID}");
-            var dir = path;
-
-            if (!string.IsNullOrWhiteSpace(fileName))
-            {
-                if (System.IO.Path.IsPathRooted(fileName)) throw new ArgumentException(nameof(fileName), "path must be a relative path");
-                path = System.IO.Path.Combine(path, fileName);
-
-                dir = System.IO.Path.GetDirectoryName(path);
-            }
-
-            System.IO.Directory.CreateDirectory(dir);
-
-            return path;
-        }
-
-        
-
-        public static void AttachShowDirLink(this TestContext context)
-        {
-            context.AttachLink("📂 Show Directory", context.GetAttachmentPath(string.Empty));
-        }
-
-        public static void AttachLink(this TestContext context, string linkPath, string targetPath)
-        {
-            linkPath = context.GetAttachmentPath(linkPath);
-
-            linkPath = ShortcutUtils.CreateLink(linkPath, targetPath);
-
-            TestContext.AddTestAttachment(linkPath);
-        }
+        }             
     }
 }

+ 2 - 2
tests/SharpGLTF.NUnit/Plotting.cs

@@ -243,14 +243,14 @@ namespace SharpGLTF
 
             NUnit.Framework.AttachmentInfo
                 .From(fileName)
-                .WriteFile(f => points.DrawToFile(f.FullName));
+                .WriteObject(f => points.DrawToFile(f.FullName));
         }
 
         public static void AttachToCurrentTest(this IEnumerable<Plotting.Point2Series> series, string fileName)
         {
             NUnit.Framework.AttachmentInfo
                 .From(fileName)
-                .WriteFile(f => Plotting.Point2Series.DrawToFile(f.FullName, series.ToArray()));
+                .WriteObject(f => Plotting.Point2Series.DrawToFile(f.FullName, series.ToArray()));
         }
     }
 }

+ 1 - 1
tests/SharpGLTF.NUnit/SharpGLTF.NUnit.csproj

@@ -11,7 +11,7 @@
     <PackageReference Include="nunit" Version="3.13.3" />
     <PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
     <PackageReference Include="GltfValidator" Version="2.0.0-dev.3.8.202205072307" />
-    <PackageReference Include="TestAttachments.NUnit" Version="3.0.0-Preview-20220609-1233" />
+    <PackageReference Include="TestAttachments.NUnit" Version="3.0.0-Preview-20220704-1041" />
   </ItemGroup>
 
   <ItemGroup>    

+ 7 - 7
tests/SharpGLTF.ThirdParty.Tests/AceCebovTests.cs

@@ -17,7 +17,7 @@ namespace SharpGLTF.ThirdParty
     using VBTexture1 = VertexBuilder<VertexPosition,VertexTexture1,VertexEmpty>;
 
     [ResourcePathFormat("*\\Assets")]
-    [AttachmentPathFormat("*\\?")]
+    [AttachmentPathFormat("*\\?", true)]
     internal class AceCebovTests
     {
         [Test]
@@ -95,11 +95,11 @@ namespace SharpGLTF.ThirdParty
 
             AttachmentInfo
                 .From("ColorMorphing.glb")
-                .WriteFile(f => model.Save(f.FullName));
+                .WriteObject(f => model.Save(f.FullName));
 
             AttachmentInfo
                 .From("ColorMorphing.gltf")
-                .WriteFile(f => model.Save(f.FullName));
+                .WriteObject(f => model.Save(f.FullName));
         }
 
         [Test]
@@ -173,11 +173,11 @@ namespace SharpGLTF.ThirdParty
 
             AttachmentInfo
                 .From("TextureMorphing.glb")
-                .WriteFile(f => model.Save(f.FullName));
+                .WriteObject(f => model.Save(f.FullName));
 
             AttachmentInfo
                 .From("TextureMorphing.gltf")
-                .WriteFile(f => model.Save(f.FullName));
+                .WriteObject(f => model.Save(f.FullName));
         }
 
         [Test]
@@ -254,11 +254,11 @@ namespace SharpGLTF.ThirdParty
 
             AttachmentInfo
                 .From("ColorAndTextureMorphing.glb")
-                .WriteFile(f => model.Save(f.FullName));
+                .WriteObject(f => model.Save(f.FullName));
 
             AttachmentInfo
                 .From("ColorAndTextureMorphing.gltf")
-                .WriteFile(f => model.Save(f.FullName));
+                .WriteObject(f => model.Save(f.FullName));
         }
     }
 }

+ 59 - 59
tests/SharpGLTF.ThirdParty.Tests/EdMackeyTests.cs

@@ -1,65 +1,65 @@
-using System;
-using System.Collections.Generic;
-using System.Numerics;
-using System.Text;
-
-using NUnit.Framework;
-
-using SharpGLTF.Geometry;
-using SharpGLTF.Materials;
-
-using VERTEX = SharpGLTF.Geometry.VertexTypes.VertexPositionNormal;
-
-namespace SharpGLTF.ThirdParty
+using System;
+using System.Collections.Generic;
+using System.Numerics;
+using System.Text;
+
+using NUnit.Framework;
+
+using SharpGLTF.Geometry;
+using SharpGLTF.Materials;
+
+using VERTEX = SharpGLTF.Geometry.VertexTypes.VertexPositionNormal;
+
+namespace SharpGLTF.ThirdParty
 {
-
-    public class EdMackeyTests
-    {
-        [Test]
-        public void TestVertexEquality()
-        {
-            var material1 = new MaterialBuilder()
-                .WithDoubleSide(true)
-                .WithMetallicRoughnessShader()
-                .WithChannelParam(KnownChannel.BaseColor, KnownProperty.RGBA, new Vector4(1, 0, 0, 1));
-
-            var mesh = new MeshBuilder<VERTEX>("mesh");
-
-            var v0 = new VERTEX(15, 5, 0, 1, 0, 0);
-            var v1 = new VERTEX(15, 5, 10, 1, 0, 0);
-            var v2 = new VERTEX(15, 0, 10, 1, 0, 0);
-            var v3 = new VERTEX(15, 0, 0, 1, 0, 0);
-
-            var prim = mesh.UsePrimitive(material1);
-            prim.AddTriangle(v0, v1, v3);
-            prim.AddTriangle(v3, v1, v2);
-
-            v0 = new VERTEX(15, 5, 10, 0, 0, 1);
-            v1 = new VERTEX(0, 5, 10, 0, 0, 1);
-            v2 = new VERTEX(0, 0, 10, 0, 0, 1);
-            v3 = new VERTEX(15, 0, 10, 0, 0, 1);
-
-            prim.AddTriangle(v0, v1, v3);
-            prim.AddTriangle(v3, v1, v2);
-
-            Assert.AreEqual(8, prim.Vertices.Count);
-
-            // create a scene
-
-            var scene = new Scenes.SceneBuilder();
-
-            scene.AddRigidMesh(mesh, Matrix4x4.Identity);
-
-            // save the model in different formats
-
+
+    public class EdMackeyTests
+    {
+        [Test]
+        public void TestVertexEquality()
+        {
+            var material1 = new MaterialBuilder()
+                .WithDoubleSide(true)
+                .WithMetallicRoughnessShader()
+                .WithChannelParam(KnownChannel.BaseColor, KnownProperty.RGBA, new Vector4(1, 0, 0, 1));
+
+            var mesh = new MeshBuilder<VERTEX>("mesh");
+
+            var v0 = new VERTEX(15, 5, 0, 1, 0, 0);
+            var v1 = new VERTEX(15, 5, 10, 1, 0, 0);
+            var v2 = new VERTEX(15, 0, 10, 1, 0, 0);
+            var v3 = new VERTEX(15, 0, 0, 1, 0, 0);
+
+            var prim = mesh.UsePrimitive(material1);
+            prim.AddTriangle(v0, v1, v3);
+            prim.AddTriangle(v3, v1, v2);
+
+            v0 = new VERTEX(15, 5, 10, 0, 0, 1);
+            v1 = new VERTEX(0, 5, 10, 0, 0, 1);
+            v2 = new VERTEX(0, 0, 10, 0, 0, 1);
+            v3 = new VERTEX(15, 0, 10, 0, 0, 1);
+
+            prim.AddTriangle(v0, v1, v3);
+            prim.AddTriangle(v3, v1, v2);
+
+            Assert.AreEqual(8, prim.Vertices.Count);
+
+            // create a scene
+
+            var scene = new Scenes.SceneBuilder();
+
+            scene.AddRigidMesh(mesh, Matrix4x4.Identity);
+
+            // save the model in different formats
+
             AttachmentInfo
                 .From("mesh.glb")
-                .WriteFile(f => scene.ToGltf2().Save(f.FullName));
+                .WriteObject(f => scene.ToGltf2().Save(f.FullName));
 
             AttachmentInfo
                 .From("mesh.gltf")
-                .WriteFile(f => scene.ToGltf2().Save(f.FullName));
-        }
-
-    }
-}
+                .WriteObject(f => scene.ToGltf2().Save(f.FullName));
+        }
+
+    }
+}

+ 4 - 6
tests/SharpGLTF.ThirdParty.Tests/PetarTasevTests.cs

@@ -14,14 +14,12 @@ namespace SharpGLTF.ThirdParty
     using VBColor1 = VertexBuilder<VertexPosition,VertexColor1,VertexEmpty>;
     
     [ResourcePathFormat("*\\Assets")]
-    [AttachmentPathFormat("*\\?")]
+    [AttachmentPathFormat("*\\?", true)]
     public class PetarTasevTests
     {
         [Test]
         public void MorphColor_MultiplePrimitives()
         {
-            TestContext.CurrentContext.AttachFolderBrowserShortcut();
-
             // create material
             var material = new MaterialBuilder("mat1")
                 .WithDoubleSide(true)
@@ -103,11 +101,11 @@ namespace SharpGLTF.ThirdParty
             // save the model in different formats
             AttachmentInfo
                 .From("ColorMorphingMultiPrim.glb")
-                .WriteFile(f => model.Save(f.FullName));
+                .WriteObject(f => model.Save(f.FullName));
 
             AttachmentInfo
                 .From("ColorMorphingMultiPrim.gltf")
-                .WriteFile(f => model.Save(f.FullName));
+                .WriteObject(f => model.Save(f.FullName));
 
             // save evaluated frames
 
@@ -117,7 +115,7 @@ namespace SharpGLTF.ThirdParty
             {
                 AttachmentInfo
                 .From($"ColorMorphingMultiPrim_{i}.obj")
-                .WriteFile(f => model.SaveAsWavefront(f.FullName, model.LogicalAnimations[0], (float)i / 5));
+                .WriteObject(f => model.SaveAsWavefront(f.FullName, model.LogicalAnimations[0], (float)i / 5));
             }
         }
     }

+ 3 - 5
tests/SharpGLTF.ThirdParty.Tests/SandboxTests.cs

@@ -18,7 +18,7 @@ namespace SharpGLTF.ThirdParty
     using VBColor1 = VertexBuilder<VertexPosition, VertexColor1, VertexEmpty>;
 
     [ResourcePathFormat("*\\Assets")]
-    [AttachmentPathFormat("*\\?")]
+    [AttachmentPathFormat("*\\?", true)]
     internal class SandboxTests
     {
         [Test]
@@ -54,8 +54,6 @@ namespace SharpGLTF.ThirdParty
         [Test]
         public void TestMorphColorTargets2()
         {
-            TestContext.CurrentContext.AttachShowDirLink();
-
             // create material
             var material = new MaterialBuilder("mat1")
                 .WithDoubleSide(true)
@@ -141,10 +139,10 @@ namespace SharpGLTF.ThirdParty
 
             var fF= AttachmentInfo
                 .From("ColorMorphingMultiPrim.gltf")
-                .WriteFile(f => model.Save(f.FullName));
+                .WriteObject(f => model.Save(f.FullName));
 
             AttachmentInfo.From("ColorMorphingMultiPrim.glb")
-                .WriteFile(f => model.Save(f.FullName));
+                .WriteObject(f => model.Save(f.FullName));
             
         }
     }

+ 1 - 1
tests/SharpGLTF.ThirdParty.Tests/SharpGLTF.ThirdParty.Tests.csproj

@@ -15,7 +15,7 @@
     <PackageReference Include="NUnit" Version="3.13.3" />
     <PackageReference Include="NUnit3TestAdapter" Version="4.2.1" />
     <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.2.0" />
-    <PackageReference Include="TestAttachments.NUnit" Version="3.0.0-Preview-20220609-1233" />    
+    <PackageReference Include="TestAttachments.NUnit" Version="3.0.0-Preview-20220704-1041" />    
   </ItemGroup>
 
   <ItemGroup>

+ 8 - 16
tests/SharpGLTF.Toolkit.Tests/Geometry/MeshBuilderAdvancedTests.cs

@@ -23,8 +23,7 @@ namespace SharpGLTF.Geometry
     {
         [Test(Description = "Creates a scene using a mesh builder helper class")]
         public void CreateSceneWithMeshBuilder()
-        {
-            TestContext.CurrentContext.AttachShowDirLink();
+        {            
             TestContext.CurrentContext.AttachGltfValidatorLinks();
 
             // create a material
@@ -56,8 +55,7 @@ namespace SharpGLTF.Geometry
 
         [Test(Description = "Creates a scene with 4 meshes, where the meshes have been initialized so they can share the same vertex and index buffers")]
         public void CreateSceneWithSharedBuffers()
-        {
-            TestContext.CurrentContext.AttachShowDirLink();
+        {            
             TestContext.CurrentContext.AttachGltfValidatorLinks();
 
             // create materials
@@ -121,8 +119,7 @@ namespace SharpGLTF.Geometry
 
         [Test(Description = "Creates a node animated scene.")]
         public void CreateSceneWithAnimatedMeshBuilder()
-        {
-            TestContext.CurrentContext.AttachShowDirLink();
+        {            
             TestContext.CurrentContext.AttachGltfValidatorLinks();            
 
             // create a material
@@ -160,8 +157,7 @@ namespace SharpGLTF.Geometry
 
         [Test(Description = "Creates a skinned animated scene.")]
         public void CreateSceneWithSkinnedAnimatedMeshBuilder()
-        {
-            TestContext.CurrentContext.AttachShowDirLink();
+        {            
             TestContext.CurrentContext.AttachGltfValidatorLinks();
             
             // create animation sequence with 4 frames
@@ -245,8 +241,7 @@ namespace SharpGLTF.Geometry
 
         [Test(Description = "Creates a textured terrain mesh.")]
         public void CreateSceneWithTerrain()
-        {
-            TestContext.CurrentContext.AttachShowDirLink();
+        {            
             TestContext.CurrentContext.AttachGltfValidatorLinks();
 
             // texture path
@@ -292,8 +287,7 @@ namespace SharpGLTF.Geometry
 
         [Test(Description = "Creates a scene with 1 million points cloud.")]        
         public void CreateSceneWithPointCloud()
-        {
-            TestContext.CurrentContext.AttachShowDirLink();
+        {            
             TestContext.CurrentContext.AttachGltfValidatorLinks();
 
             var material = new MaterialBuilder("material1").WithUnlitShader();            
@@ -348,8 +342,7 @@ namespace SharpGLTF.Geometry
 
         [Test(Description ="Creates a single mesh with multiple cubes.")]
         public void CreateMeshWithRandomCubes()
-        {
-            TestContext.CurrentContext.AttachShowDirLink();
+        {            
             TestContext.CurrentContext.AttachGltfValidatorLinks();
 
             var rnd = new Random();
@@ -386,8 +379,7 @@ namespace SharpGLTF.Geometry
 
         [Test(Description ="Simulates animating mesh visibility by setting scale to (0,0,0)")]
         public void CreateSceneWithAnimatedVisibility()
-        {
-            TestContext.CurrentContext.AttachShowDirLink();
+        {            
             TestContext.CurrentContext.AttachGltfValidatorLinks();            
 
             // create a mesh

+ 1 - 2
tests/SharpGLTF.Toolkit.Tests/Materials/ContentSharingTests.cs

@@ -56,8 +56,7 @@ namespace SharpGLTF.Materials
 
         [Test]
         public void WriteTwoModelsWithSharedTexture()
-        {
-            TestContext.CurrentContext.AttachShowDirLink();
+        {            
             TestContext.CurrentContext.AttachGltfValidatorLinks();            
 
             var tex1Bytes = System.IO.File.ReadAllBytes(System.IO.Path.Combine(AssetsPath, "shannon.png"));

+ 14 - 28
tests/SharpGLTF.Toolkit.Tests/Scenes/SceneBuilderTests.cs

@@ -24,8 +24,7 @@ namespace SharpGLTF.Scenes
     {
         [Test(Description ="Creates a simple cube.")]
         public void CreateCubeScene()
-        {
-            TestContext.CurrentContext.AttachShowDirLink();
+        {            
             TestContext.CurrentContext.AttachGltfValidatorLinks();
 
             var material = MaterialBuilder.CreateDefault();            
@@ -43,8 +42,7 @@ namespace SharpGLTF.Scenes
 
         [Test(Description = "Creates a simple cube.")]
         public void CreateCubeSceneWithExtras()
-        {
-            TestContext.CurrentContext.AttachShowDirLink();
+        {            
             TestContext.CurrentContext.AttachGltfValidatorLinks();
 
             var material = MaterialBuilder.CreateDefault();
@@ -68,8 +66,7 @@ namespace SharpGLTF.Scenes
 
         [Test(Description ="Creates a cube attached to an animated node.")]
         public void CreateAnimatedCubeScene()
-        {
-            TestContext.CurrentContext.AttachShowDirLink();
+        {            
             TestContext.CurrentContext.AttachGltfValidatorLinks();
 
             var material = MaterialBuilder.CreateDefault();
@@ -101,8 +98,7 @@ namespace SharpGLTF.Scenes
 
         [Test(Description = "Checks that non convex quads are created correctly.")]
         public void CreateNonConvexQuadsScene()
-        {
-            TestContext.CurrentContext.AttachShowDirLink();
+        {            
             TestContext.CurrentContext.AttachGltfValidatorLinks();
             
             var mesh = new MeshBuilder<VertexPosition>();
@@ -143,8 +139,7 @@ namespace SharpGLTF.Scenes
         [TestCase(false)]
         [TestCase(true)]
         public void CreateSceneWithRandomShapes(bool useGpuInstancing)
-        {
-            TestContext.CurrentContext.AttachShowDirLink();
+        {            
             TestContext.CurrentContext.AttachGltfValidatorLinks();
 
             var rnd = new Random(177);
@@ -225,8 +220,7 @@ namespace SharpGLTF.Scenes
 
         [Test]
         public void CreateSceneWithMixedVertexFormats()
-        {
-            TestContext.CurrentContext.AttachShowDirLink();
+        {            
             TestContext.CurrentContext.AttachGltfValidatorLinks();
 
             var scene = new SceneBuilder();
@@ -245,8 +239,7 @@ namespace SharpGLTF.Scenes
         
         [Test]
         public void CreateSkinnedScene()
-        {
-            TestContext.CurrentContext.AttachShowDirLink();
+        {            
             TestContext.CurrentContext.AttachGltfValidatorLinks();
             
             // create two materials
@@ -332,8 +325,7 @@ namespace SharpGLTF.Scenes
 
         [Test]
         public void CreateDoubleSkinnedScene()
-        {
-            TestContext.CurrentContext.AttachShowDirLink();
+        {            
             TestContext.CurrentContext.AttachGltfValidatorLinks();
 
             // create two materials
@@ -443,8 +435,7 @@ namespace SharpGLTF.Scenes
         public void CreateAllAnimationTypesScene()
         {
             // 3D View 7.1908.9012.0 has an issue displaying off-center meshes with animated morph targets.
-
-            TestContext.CurrentContext.AttachShowDirLink();
+                        
             TestContext.CurrentContext.AttachGltfValidatorLinks();
 
             // create two materials
@@ -510,8 +501,7 @@ namespace SharpGLTF.Scenes
             // SceneBuilder API supports reusing a NodeBuilder in multiple instances with different content.
             // but glTF nodes can only hold one mesh per node, so if we find this case we need to internally
             // add an additional child node to give room to the the extra mesh.
-
-            TestContext.CurrentContext.AttachShowDirLink();
+                        
             TestContext.CurrentContext.AttachGltfValidatorLinks();
 
             var m = MaterialBuilder.CreateDefault();
@@ -544,8 +534,7 @@ namespace SharpGLTF.Scenes
         [TestCase("RiggedFigure.glb")]
         [TestCase("RiggedSimple.glb")]
         public void TestRoundTrip(string path)
-        {
-            TestContext.CurrentContext.AttachShowDirLink();
+        {            
             TestContext.CurrentContext.AttachGltfValidatorLinks();
 
             path = TestFiles
@@ -616,7 +605,6 @@ namespace SharpGLTF.Scenes
         [TestCase("GearboxAssy.glb")]        
         public void ExportMeshes(string path)
         {
-            TestContext.CurrentContext.AttachShowDirLink();
             TestContext.CurrentContext.AttachGltfValidatorLinks();
 
             path = TestFiles
@@ -663,7 +651,7 @@ namespace SharpGLTF.Scenes
 
             schema.CreateMesh("Empty2");
 
-            var fileName = TestContext.CurrentContext.GetAttachmentPath("empty.glb", true);
+            var fileName = AttachmentInfo.From("empty.glb").File.FullName;
 
             Assert.Throws<SharpGLTF.Validation.SchemaException>(() => schema.SaveGLB(fileName));
         }
@@ -673,8 +661,7 @@ namespace SharpGLTF.Scenes
         {
             // Schema2 does NOT allow meshes to be empty, or meshes with empty MeshPrimitives.
             // but MeshBuilder and SceneBuilder should be able to handle them.
-
-            TestContext.CurrentContext.AttachShowDirLink();
+                        
             TestContext.CurrentContext.AttachGltfValidatorLinks();
 
             var rnd = new Random(177);
@@ -810,8 +797,7 @@ namespace SharpGLTF.Scenes
         public void CreateMorphScene()
         {
             // 3D View 7.1908.9012.0 has an issue displaying off-center meshes with animated morph targets.
-
-            TestContext.CurrentContext.AttachShowDirLink();
+                        
             TestContext.CurrentContext.AttachGltfValidatorLinks();
 
             var meshMorphs = CreateMeshWith16MorphTargets();