Browse Source

Fixing test asset paths to reduce file copies

vpenades 1 year ago
parent
commit
5a1d0950a0
31 changed files with 88 additions and 141 deletions
  1. 1 1
      tests/SharpGLTF.Cesium.Tests/ExtInstanceFeaturesTests.cs
  2. 1 1
      tests/SharpGLTF.Cesium.Tests/ExtMeshFeaturesTests.cs
  3. 1 1
      tests/SharpGLTF.Cesium.Tests/ExtStructuralMetadataTests.cs
  4. 1 1
      tests/SharpGLTF.Cesium.Tests/GenericTests.cs
  5. 10 0
      tests/SharpGLTF.Cesium.Tests/Properties/AssemblyInfo.cs
  6. 2 22
      tests/SharpGLTF.Cesium.Tests/SharpGLTF.Cesium.Tests.csproj
  7. 1 1
      tests/SharpGLTF.Core.Tests/AssemblyAPITests.cs
  8. 1 1
      tests/SharpGLTF.Core.Tests/Properties/AssemblyInfo.cs
  9. 4 12
      tests/SharpGLTF.Core.Tests/Schema2/Authoring/ExtensionsCreationTests.cs
  10. 1 1
      tests/SharpGLTF.Core.Tests/Schema2/LoadAndSave/LoadInvalidTests.cs
  11. 10 18
      tests/SharpGLTF.Core.Tests/Schema2/LoadAndSave/LoadSpecialModelsTest.cs
  12. 2 3
      tests/SharpGLTF.Core.Tests/Schema2/LoadAndSave/RegressionTests.cs
  13. 1 3
      tests/SharpGLTF.Core.Tests/Schema2/LoadAndSave/XmpJsonTests.cs
  14. 2 6
      tests/SharpGLTF.Core.Tests/SharpGLTF.Core.Tests.csproj
  15. 4 6
      tests/SharpGLTF.NUnit/NUnitUtils.cs
  16. 1 1
      tests/SharpGLTF.Runtime.Tests/Properties/AssemblyInfo.cs
  17. 1 5
      tests/SharpGLTF.Runtime.Tests/SharpGLTF.Runtime.Tests.csproj
  18. 2 4
      tests/SharpGLTF.ThirdParty.Tests/AceCebovTests.cs
  19. 1 2
      tests/SharpGLTF.ThirdParty.Tests/CesiumInstancingTests.cs
  20. 1 3
      tests/SharpGLTF.ThirdParty.Tests/MeltyPlayerTests.cs
  21. 1 3
      tests/SharpGLTF.ThirdParty.Tests/PetarTasevTests.cs
  22. 10 0
      tests/SharpGLTF.ThirdParty.Tests/Properties/AssemblyInfo.cs
  23. 1 3
      tests/SharpGLTF.ThirdParty.Tests/SandboxTests.cs
  24. 1 5
      tests/SharpGLTF.ThirdParty.Tests/SharpGLTF.ThirdParty.Tests.csproj
  25. 1 3
      tests/SharpGLTF.ThirdParty.Tests/SteamDbTests.cs
  26. 1 1
      tests/SharpGLTF.Toolkit.Tests/Geometry/MeshBuilderAdvancedTests.cs
  27. 4 4
      tests/SharpGLTF.Toolkit.Tests/Materials/ContentSharingTests.cs
  28. 11 16
      tests/SharpGLTF.Toolkit.Tests/Materials/MaterialBuilderTests.cs
  29. 4 6
      tests/SharpGLTF.Toolkit.Tests/Properties/AssemblyInfo.cs
  30. 5 3
      tests/SharpGLTF.Toolkit.Tests/Scenes/SceneBuilderTests.cs
  31. 1 5
      tests/SharpGLTF.Toolkit.Tests/SharpGLTF.Toolkit.Tests.csproj

+ 1 - 1
tests/SharpGLTF.Cesium.Tests/ExtInstanceFeaturesTests.cs

@@ -26,7 +26,7 @@ namespace SharpGLTF.Schema2.Tiles3D
         [TestCase(@"ValidInstanceFeatures.gltf", null)]
         [TestCase(@"ValidInstanceFeatures.gltf", null)]
         public void ReadExtInstanceFeatures(string file, Type exception = null)
         public void ReadExtInstanceFeatures(string file, Type exception = null)
         {
         {
-            var fileName = $"./testfixtures/instanceFeatures/{file}";
+            var fileName = ResourceInfo.From($"instanceFeatures/{file}");
 
 
             if (exception != null)
             if (exception != null)
             {
             {

+ 1 - 1
tests/SharpGLTF.Cesium.Tests/ExtMeshFeaturesTests.cs

@@ -60,7 +60,7 @@ namespace SharpGLTF.Schema2.Tiles3D
         [TestCase("ValidFeatureIdTextureUsingDefaultChannels.gltf", null)]
         [TestCase("ValidFeatureIdTextureUsingDefaultChannels.gltf", null)]
         public void ReadExtMeshFeaturesFiles(string file, Type exception = null)
         public void ReadExtMeshFeaturesFiles(string file, Type exception = null)
         {
         {
-            var fileName = $"./testfixtures/meshFeatures/{file}";
+            var fileName = ResourceInfo.From($"meshFeatures/{file}");
 
 
             if (exception != null)
             if (exception != null)
             {
             {

+ 1 - 1
tests/SharpGLTF.Cesium.Tests/ExtStructuralMetadataTests.cs

@@ -67,7 +67,7 @@ namespace SharpGLTF.Schema2.Tiles3D
 
 
         public void ReadExtStructuralMetadata(string file, Type exception = null)
         public void ReadExtStructuralMetadata(string file, Type exception = null)
         {
         {
-            var fileName = $"./testfixtures/structuralMetadata/{file}";
+            var fileName = ResourceInfo.From($"structuralMetadata/{file}");
 
 
             if (exception != null)
             if (exception != null)
             {
             {

+ 1 - 1
tests/SharpGLTF.Cesium.Tests/GenericTests.cs

@@ -27,7 +27,7 @@ namespace SharpGLTF
         [TestCase("ValidFeatureIdTextureAndPropertyTable.gltf", null)]
         [TestCase("ValidFeatureIdTextureAndPropertyTable.gltf", null)]
         public void ReadGenericFiles(string file, Type exception = null)
         public void ReadGenericFiles(string file, Type exception = null)
         {
         {
-            var fileName = $"./testfixtures/{file}";
+            var fileName = ResourceInfo.From(file);
 
 
             if (exception != null)
             if (exception != null)
             {
             {

+ 10 - 0
tests/SharpGLTF.Cesium.Tests/Properties/AssemblyInfo.cs

@@ -0,0 +1,10 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+using NUnit.Framework;
+
+[assembly: ResourcePathFormat("{ProjectDirectory}/TestFixtures")]
+[assembly: AttachmentPathFormat("*/TestResults/?", true)]

+ 2 - 22
tests/SharpGLTF.Cesium.Tests/SharpGLTF.Cesium.Tests.csproj

@@ -5,13 +5,7 @@
     <IsPackable>false</IsPackable>
     <IsPackable>false</IsPackable>
     <RootNamespace>SharpGLTF</RootNamespace>
     <RootNamespace>SharpGLTF</RootNamespace>
     <LangVersion>latest</LangVersion>
     <LangVersion>latest</LangVersion>
-  </PropertyGroup>
-
-  <!--
-  <ItemGroup>
-    <Compile Remove="ExtStructuralMetadataTests.cs" />
-  </ItemGroup>  
-  -->
+  </PropertyGroup>  
 
 
   <ItemGroup>
   <ItemGroup>
     <ProjectReference Include="..\..\src\SharpGLTF.Ext.3DTiles\SharpGLTF.Ext.3DTiles.csproj" />
     <ProjectReference Include="..\..\src\SharpGLTF.Ext.3DTiles\SharpGLTF.Ext.3DTiles.csproj" />
@@ -25,19 +19,5 @@
     </PackageReference>
     </PackageReference>
     <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
     <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
   </ItemGroup>
   </ItemGroup>
-
-  <ItemGroup>
-	<Folder Include="testfixtures\meshFeatures\" />
-	<Folder Include="testfixtures\instanceFeatures\" />
-    <Folder Include="testfixtures\structuralMetadata\" />
-	<None Update="testfixtures\**\*" CopyToOutputDirectory="PreserveNewest" />
-
-  </ItemGroup>
-
-  <ItemGroup>
-    <None Update="tree.glb">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </None>
-  </ItemGroup>
-
+  
 </Project>
 </Project>

+ 1 - 1
tests/SharpGLTF.Core.Tests/AssemblyAPITests.cs

@@ -99,7 +99,7 @@ namespace SharpGLTF
 
 
         private static void _CheckBackwardsCompatibility(string referenceAPIFile, string[] newLines)
         private static void _CheckBackwardsCompatibility(string referenceAPIFile, string[] newLines)
         {
         {
-            referenceAPIFile = System.IO.Path.Combine(TestContext.CurrentContext.WorkDirectory, "Assets", referenceAPIFile);
+            referenceAPIFile = ResourceInfo.From(referenceAPIFile).FilePath;
 
 
             var refLines = System.IO.File.ReadAllLines(referenceAPIFile);
             var refLines = System.IO.File.ReadAllLines(referenceAPIFile);
 
 

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

@@ -6,5 +6,5 @@ using System.Threading.Tasks;
 
 
 using NUnit.Framework;
 using NUnit.Framework;
 
 
-[assembly: ResourcePathFormat("*/Assets")]
+[assembly: ResourcePathFormat("{SolutionDirectory}/tests/Assets")]
 [assembly: AttachmentPathFormat("*/TestResults/?", true)]
 [assembly: AttachmentPathFormat("*/TestResults/?", true)]

+ 4 - 12
tests/SharpGLTF.Core.Tests/Schema2/Authoring/ExtensionsCreationTests.cs

@@ -204,19 +204,13 @@ namespace SharpGLTF.Schema2.Authoring
         [TestCase("FlightHelmet_baseColor_basis.ktx2")]
         [TestCase("FlightHelmet_baseColor_basis.ktx2")]
         public void CreateSceneWithTextureImageExtension(string textureFileName)
         public void CreateSceneWithTextureImageExtension(string textureFileName)
         {            
         {            
-            TestContext.CurrentContext.AttachGltfValidatorLinks();
-
-            var basePath = System.IO.Path.Combine(TestContext.CurrentContext.WorkDirectory, "Assets");
+            TestContext.CurrentContext.AttachGltfValidatorLinks();            
 
 
             // first, create a default material
             // first, create a default material
             var material = new Materials.MaterialBuilder("material1")
             var material = new Materials.MaterialBuilder("material1")
                 .WithDoubleSide(true)
                 .WithDoubleSide(true)
                 .WithMetallicRoughnessShader()
                 .WithMetallicRoughnessShader()
-                .WithChannelImage
-                (
-                    Materials.KnownChannel.BaseColor,
-                    System.IO.Path.Combine(basePath, textureFileName)
-                );                
+                .WithChannelImage(Materials.KnownChannel.BaseColor, ResourceInfo.From(textureFileName).FilePath);                
 
 
             var mesh = new Geometry.MeshBuilder<VPOS, VTEX>("mesh1");
             var mesh = new Geometry.MeshBuilder<VPOS, VTEX>("mesh1");
 
 
@@ -245,15 +239,13 @@ namespace SharpGLTF.Schema2.Authoring
         [Test]
         [Test]
         public void CrateSceneWithTextureTransformExtension()
         public void CrateSceneWithTextureTransformExtension()
         {            
         {            
-            TestContext.CurrentContext.AttachGltfValidatorLinks();
-
-            var basePath = System.IO.Path.Combine(TestContext.CurrentContext.WorkDirectory, "Assets");
+            TestContext.CurrentContext.AttachGltfValidatorLinks();            
 
 
             // first, create a default material
             // first, create a default material
             var material = new Materials.MaterialBuilder("material1")
             var material = new Materials.MaterialBuilder("material1")
                 .WithDoubleSide(true)
                 .WithDoubleSide(true)
                 .WithMetallicRoughnessShader()
                 .WithMetallicRoughnessShader()
-                .WithChannelImage(Materials.KnownChannel.BaseColor, System.IO.Path.Combine(basePath, "shannon.jpg"));
+                .WithChannelImage(Materials.KnownChannel.BaseColor, ResourceInfo.From("shannon.jpg").FilePath);
 
 
             material.GetChannel(Materials.KnownChannel.BaseColor).UseTexture().WithTransform(0.40f,0.25f, 0.5f,0.5f);
             material.GetChannel(Materials.KnownChannel.BaseColor).UseTexture().WithTransform(0.40f,0.25f, 0.5f,0.5f);
 
 

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

@@ -14,7 +14,7 @@ namespace SharpGLTF.Schema2.LoadAndSave
         [Test]
         [Test]
         public void LoadInvalidJsonModel()
         public void LoadInvalidJsonModel()
         {
         {
-            var path = System.IO.Path.Combine(TestContext.CurrentContext.TestDirectory, "Assets", "Invalid_Json.gltf");            
+            var path = ResourceInfo.From("Invalid_Json.gltf").FilePath;
 
 
             Assert.Throws<Validation.SchemaException>(() => ModelRoot.Load(path));
             Assert.Throws<Validation.SchemaException>(() => ModelRoot.Load(path));
 
 

+ 10 - 18
tests/SharpGLTF.Core.Tests/Schema2/LoadAndSave/LoadSpecialModelsTest.cs

@@ -29,9 +29,7 @@ namespace SharpGLTF.Schema2.LoadAndSave
         [Test]
         [Test]
         public void LoadEscapedUriModel()
         public void LoadEscapedUriModel()
         {
         {
-            var path = System.IO.Path.Combine(TestContext.CurrentContext.TestDirectory, "Assets\\white space.gltf");
-
-            var model = ModelRoot.Load(path);
+            var model = ModelRoot.Load(ResourceInfo.From("white space.gltf"));
             Assert.That(model, Is.Not.Null);
             Assert.That(model, Is.Not.Null);
 
 
             model.AttachToCurrentTest("white space.glb");
             model.AttachToCurrentTest("white space.glb");
@@ -124,9 +122,7 @@ namespace SharpGLTF.Schema2.LoadAndSave
         // [Test]
         // [Test]
         public void LoadShrekshaoModel()
         public void LoadShrekshaoModel()
         {
         {
-            var path = "Assets\\SpecialCases\\shrekshao.glb";
-
-            var model = ModelRoot.Load(path);
+            var model = ModelRoot.Load(ResourceInfo.From("SpecialCases\\shrekshao.glb"));
             Assert.That(model, Is.Not.Null);
             Assert.That(model, Is.Not.Null);
         }
         }
 
 
@@ -135,10 +131,8 @@ namespace SharpGLTF.Schema2.LoadAndSave
         {
         {
             // this model has several nodes with curve animations containing a single animation key,
             // this model has several nodes with curve animations containing a single animation key,
             // which is causing some problems to the interpolator.            
             // which is causing some problems to the interpolator.            
-            
-            var path = System.IO.Path.Combine(TestContext.CurrentContext.TestDirectory, "Assets\\SpecialCases\\mouse.glb");
 
 
-            var model = ModelRoot.Load(path);
+            var model = ModelRoot.Load(ResourceInfo.From("SpecialCases\\mouse.glb"));
 
 
             var boundingSphere = Runtime.MeshDecoder.EvaluateBoundingSphere(model.DefaultScene);
             var boundingSphere = Runtime.MeshDecoder.EvaluateBoundingSphere(model.DefaultScene);
 
 
@@ -161,11 +155,9 @@ namespace SharpGLTF.Schema2.LoadAndSave
         public void LoadSketchfabModels(string path)
         public void LoadSketchfabModels(string path)
         {
         {
             // this model has several nodes with curve animations containing a single animation key,
             // this model has several nodes with curve animations containing a single animation key,
-            // which is causing some problems to the interpolator.            
-
-            path = System.IO.Path.Combine(TestContext.CurrentContext.TestDirectory, $"Assets\\SpecialCases\\{path}");
+            // which is causing some problems to the interpolator.
 
 
-            var model = ModelRoot.Load(path, Validation.ValidationMode.TryFix);
+            var model = ModelRoot.Load(ResourceInfo.From($"SpecialCases\\{path}"), Validation.ValidationMode.TryFix);
 
 
             model.AttachToCurrentTest("output.glb");            
             model.AttachToCurrentTest("output.glb");            
         }
         }
@@ -220,18 +212,18 @@ namespace SharpGLTF.Schema2.LoadAndSave
         [Test]
         [Test]
         public void LoadInvalidModelWithJsonFix()
         public void LoadInvalidModelWithJsonFix()
         {
         {
-            // try to load an invalid gltf with an empty array
+            // try to load an invalid gltf with an empty array            
 
 
-            var path = System.IO.Path.Combine(TestContext.CurrentContext.TestDirectory, "Assets\\SpecialCases\\Invalid_EmptyArray.gltf");
+            var xpath = ResourceInfo.From("SpecialCases\\Invalid_EmptyArray.gltf");
 
 
-            Assert.Throws<Validation.SchemaException>(() => ModelRoot.Load(path));
+            Assert.Throws<Validation.SchemaException>(() => ModelRoot.Load(xpath));
 
 
             // try to load an invalid gltf with an empty array, using a hook to fix the json before running the parser.
             // try to load an invalid gltf with an empty array, using a hook to fix the json before running the parser.
 
 
             var rsettings = new ReadSettings();
             var rsettings = new ReadSettings();
             rsettings.JsonPreprocessor = _RemoveEmptyArrayJsonProcessor;
             rsettings.JsonPreprocessor = _RemoveEmptyArrayJsonProcessor;
 
 
-            var model = ModelRoot.Load(path, rsettings);
+            var model = ModelRoot.Load(xpath, rsettings);
             Assert.That(model, Is.Not.Null);
             Assert.That(model, Is.Not.Null);
 
 
             // save the model, using a hook to modify the json before writing it to the file.
             // save the model, using a hook to modify the json before writing it to the file.
@@ -242,7 +234,7 @@ namespace SharpGLTF.Schema2.LoadAndSave
                 json = json.Replace("glTF 2.0 Validator test suite", "postprocessed json"); return json;
                 json = json.Replace("glTF 2.0 Validator test suite", "postprocessed json"); return json;
             };
             };
 
 
-            path = model.AttachToCurrentTest("modified.gltf", wsettings);
+            var path = model.AttachToCurrentTest("modified.gltf", wsettings);
 
 
             model = ModelRoot.Load(path);
             model = ModelRoot.Load(path);
 
 

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

@@ -10,8 +10,7 @@ using SharpGLTF.Validation;
 
 
 namespace SharpGLTF.Schema2.LoadAndSave
 namespace SharpGLTF.Schema2.LoadAndSave
 {
 {
-    [AttachmentPathFormat("*/TestResults/LoadAndSave/?", true)]
-    [ResourcePathFormat("*/Assets/SpecialCases")]
+    [AttachmentPathFormat("*/TestResults/LoadAndSave/?", true)]    
     internal class RegressionTests
     internal class RegressionTests
     {
     {
         [Test]
         [Test]
@@ -21,7 +20,7 @@ namespace SharpGLTF.Schema2.LoadAndSave
 
 
             var cdir = Environment.CurrentDirectory;
             var cdir = Environment.CurrentDirectory;
 
 
-            var modelPath = ResourceInfo.From("RelativePaths.gltf");
+            var modelPath = ResourceInfo.From("SpecialCases/RelativePaths.gltf");
 
 
             // absolute path            
             // absolute path            
 
 

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

@@ -19,9 +19,7 @@ namespace SharpGLTF.Schema2.LoadAndSave
         [Test]
         [Test]
         public void LoadXmpModel()
         public void LoadXmpModel()
         {
         {
-            var path = System.IO.Path.Combine(TestContext.CurrentContext.TestDirectory, "Assets\\XmpJsonLd.gltf");
-
-            var model = ModelRoot.Load(path);
+            var model = ModelRoot.Load(ResourceInfo.From("XmpJsonLd.gltf"));
             Assert.That(model, Is.Not.Null);
             Assert.That(model, Is.Not.Null);
 
 
             var packets = model.GetExtension<XmpPackets>();
             var packets = model.GetExtension<XmpPackets>();

+ 2 - 6
tests/SharpGLTF.Core.Tests/SharpGLTF.Core.Tests.csproj

@@ -4,12 +4,8 @@
     <TargetFrameworks>net471;net6.0;net8.0</TargetFrameworks>
     <TargetFrameworks>net471;net6.0;net8.0</TargetFrameworks>
     <IsPackable>false</IsPackable>
     <IsPackable>false</IsPackable>
     <RootNamespace>SharpGLTF</RootNamespace>
     <RootNamespace>SharpGLTF</RootNamespace>
-    <LangVersion>latest</LangVersion>
-  </PropertyGroup>
-
-  <ItemGroup>
-    <Content Include="..\Assets\**" LinkBase="Assets" CopyToOutputDirectory="PreserveNewest" />
-  </ItemGroup>
+    <LangVersion>latest</LangVersion>    
+  </PropertyGroup>  
 
 
   <ItemGroup>    
   <ItemGroup>    
     <ProjectReference Include="..\SharpGLTF.NUnit\SharpGLTF.NUnit.csproj" />
     <ProjectReference Include="..\SharpGLTF.NUnit\SharpGLTF.NUnit.csproj" />

+ 4 - 6
tests/SharpGLTF.NUnit/NUnitUtils.cs

@@ -9,16 +9,14 @@ namespace SharpGLTF
 {
 {
     public static class NUnitUtils
     public static class NUnitUtils
     {
     {
-        public static string ToShortDisplayPath(this string path)
+        public static string ToShortDisplayPath(this string path, int maxDirLength = 12)
         {
         {
             var dir = System.IO.Path.GetDirectoryName(path);
             var dir = System.IO.Path.GetDirectoryName(path);
-            var fxt = System.IO.Path.GetFileName(path);
+            var fxt = System.IO.Path.GetFileName(path);            
 
 
-            const int maxdir = 12;
-
-            if (dir.Length > maxdir)
+            if (dir.Length > maxDirLength)
             {
             {
-                dir = "..." + dir.Substring(dir.Length - maxdir);
+                dir = "..." + dir.Substring(dir.Length - maxDirLength);
             }
             }
 
 
             return System.IO.Path.Combine(dir, fxt);
             return System.IO.Path.Combine(dir, fxt);

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

@@ -6,5 +6,5 @@ using System.Threading.Tasks;
 
 
 using NUnit.Framework;
 using NUnit.Framework;
 
 
-[assembly: ResourcePathFormat("*/Assets")]
+[assembly: ResourcePathFormat("{SolutionDirectory}/tests/Assets")]
 [assembly: AttachmentPathFormat("*/TestResults/?", true)]
 [assembly: AttachmentPathFormat("*/TestResults/?", true)]

+ 1 - 5
tests/SharpGLTF.Runtime.Tests/SharpGLTF.Runtime.Tests.csproj

@@ -5,11 +5,7 @@
     <IsPackable>false</IsPackable>
     <IsPackable>false</IsPackable>
     <RootNamespace>SharpGLTF</RootNamespace>
     <RootNamespace>SharpGLTF</RootNamespace>
     <LangVersion>latest</LangVersion>
     <LangVersion>latest</LangVersion>
-  </PropertyGroup>
-
-  <ItemGroup>
-    <Content Include="..\Assets\**" LinkBase="Assets" CopyToOutputDirectory="PreserveNewest" />
-  </ItemGroup>
+  </PropertyGroup>  
 
 
   <ItemGroup>
   <ItemGroup>
     <ProjectReference Include="..\SharpGLTF.NUnit\SharpGLTF.NUnit.csproj" />
     <ProjectReference Include="..\SharpGLTF.NUnit\SharpGLTF.NUnit.csproj" />

+ 2 - 4
tests/SharpGLTF.ThirdParty.Tests/AceCebovTests.cs

@@ -14,10 +14,8 @@ namespace SharpGLTF.ThirdParty
 {
 {
     using VBColor1 = VertexBuilder<VertexPosition,VertexColor1,VertexEmpty>;
     using VBColor1 = VertexBuilder<VertexPosition,VertexColor1,VertexEmpty>;
     using VBColor1Texture1 = VertexBuilder<VertexPosition,VertexColor1Texture1,VertexEmpty>;
     using VBColor1Texture1 = VertexBuilder<VertexPosition,VertexColor1Texture1,VertexEmpty>;
-    using VBTexture1 = VertexBuilder<VertexPosition,VertexTexture1,VertexEmpty>;
-
-    [ResourcePathFormat("*\\Assets")]
-    [AttachmentPathFormat("*\\?", true)]
+    using VBTexture1 = VertexBuilder<VertexPosition,VertexTexture1,VertexEmpty>;    
+    
     internal class AceCebovTests
     internal class AceCebovTests
     {
     {
         [Test]
         [Test]

+ 1 - 2
tests/SharpGLTF.ThirdParty.Tests/CesiumInstancingTests.cs

@@ -11,8 +11,7 @@ namespace SharpGLTF.ThirdParty
 {
 {
     public class CesiumTests
     public class CesiumTests
     {
     {
-        [Test]
-        [ResourcePathFormat("*\\Assets")]
+        [Test]        
         public void WriteInstancedGlbWithFeatureIds()
         public void WriteInstancedGlbWithFeatureIds()
         {
         {
             var modelRoot = ModelRoot.Load(ResourceInfo.From("tree.glb"));
             var modelRoot = ModelRoot.Load(ResourceInfo.From("tree.glb"));

+ 1 - 3
tests/SharpGLTF.ThirdParty.Tests/MeltyPlayerTests.cs

@@ -15,9 +15,7 @@ using SharpGLTF.Schema2;
 using SharpGLTF.Transforms;
 using SharpGLTF.Transforms;
 
 
 namespace SharpGLTF.ThirdParty
 namespace SharpGLTF.ThirdParty
-{
-    [ResourcePathFormat("*\\Assets")]
-    [AttachmentPathFormat("*\\?", true)]
+{    
     internal class MeltyPlayerTests
     internal class MeltyPlayerTests
     {
     {
         /// <summary>
         /// <summary>

+ 1 - 3
tests/SharpGLTF.ThirdParty.Tests/PetarTasevTests.cs

@@ -11,10 +11,8 @@ using SharpGLTF.Validation;
 
 
 namespace SharpGLTF.ThirdParty
 namespace SharpGLTF.ThirdParty
 {
 {
-    using VBColor1 = VertexBuilder<VertexPosition,VertexColor1,VertexEmpty>;
+    using VBColor1 = VertexBuilder<VertexPosition,VertexColor1,VertexEmpty>;    
     
     
-    [ResourcePathFormat("*\\Assets")]
-    [AttachmentPathFormat("*\\?", true)]
     public class PetarTasevTests
     public class PetarTasevTests
     {
     {
         [Test]
         [Test]

+ 10 - 0
tests/SharpGLTF.ThirdParty.Tests/Properties/AssemblyInfo.cs

@@ -0,0 +1,10 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+using NUnit.Framework;
+
+[assembly: ResourcePathFormat("{SolutionDirectory}/tests/Assets")]
+[assembly: AttachmentPathFormat("*/TestResults/?", true)]

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

@@ -17,9 +17,7 @@ using SharpGLTF.Validation;
 namespace SharpGLTF.ThirdParty
 namespace SharpGLTF.ThirdParty
 {
 {
     using VBColor1 = VertexBuilder<VertexPosition, VertexColor1, VertexEmpty>;
     using VBColor1 = VertexBuilder<VertexPosition, VertexColor1, VertexEmpty>;
-
-    [ResourcePathFormat("*\\Assets")]
-    [AttachmentPathFormat("*\\?", true)]
+    
     internal class SandboxTests
     internal class SandboxTests
     {
     {
         [Test]
         [Test]

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

@@ -5,11 +5,7 @@
     <IsPackable>false</IsPackable>
     <IsPackable>false</IsPackable>
     <RootNamespace>SharpGLTF.ThirdParty</RootNamespace>
     <RootNamespace>SharpGLTF.ThirdParty</RootNamespace>
     <LangVersion>latest</LangVersion>
     <LangVersion>latest</LangVersion>
-  </PropertyGroup>
-
-  <ItemGroup>
-    <Content Include="..\Assets\**" LinkBase="Assets" CopyToOutputDirectory="PreserveNewest" />
-  </ItemGroup>
+  </PropertyGroup>  
 
 
   <ItemGroup>
   <ItemGroup>
     <Compile Include="..\SharpGLTF.Toolkit.Tests\Geometry\Parametric\SolidMeshUtils.cs" Link="Geometry\Parametric\SolidMeshUtils.cs" />
     <Compile Include="..\SharpGLTF.Toolkit.Tests\Geometry\Parametric\SolidMeshUtils.cs" Link="Geometry\Parametric\SolidMeshUtils.cs" />

+ 1 - 3
tests/SharpGLTF.ThirdParty.Tests/SteamDbTests.cs

@@ -12,9 +12,7 @@ using SharpGLTF.Geometry.Parametric;
 using SharpGLTF.Geometry;
 using SharpGLTF.Geometry;
 
 
 namespace SharpGLTF.ThirdParty
 namespace SharpGLTF.ThirdParty
-{
-    [ResourcePathFormat("*\\Assets")]
-    [AttachmentPathFormat("*\\?")]
+{    
     internal class SteamDbTests
     internal class SteamDbTests
     {
     {
         [Test]
         [Test]

+ 1 - 1
tests/SharpGLTF.Toolkit.Tests/Geometry/MeshBuilderAdvancedTests.cs

@@ -245,7 +245,7 @@ namespace SharpGLTF.Geometry
             TestContext.CurrentContext.AttachGltfValidatorLinks();
             TestContext.CurrentContext.AttachGltfValidatorLinks();
 
 
             // texture path
             // texture path
-            var imagePath = System.IO.Path.Combine(TestContext.CurrentContext.WorkDirectory, "Assets", "Texture1.jpg");
+            var imagePath = ResourceInfo.From("Texture1.jpg");
 
 
             // fancy height function; can be easily replaced with a bitmap sampler.
             // fancy height function; can be easily replaced with a bitmap sampler.
             float heightFunction(int xx, int yy)
             float heightFunction(int xx, int yy)

+ 4 - 4
tests/SharpGLTF.Toolkit.Tests/Materials/ContentSharingTests.cs

@@ -18,12 +18,12 @@ namespace SharpGLTF.Materials
     [Category("Toolkit.Materials")]
     [Category("Toolkit.Materials")]
     public class ContentSharingTests
     public class ContentSharingTests
     {
     {
-        private static string AssetsPath = System.IO.Path.Combine(TestContext.CurrentContext.TestDirectory, "Assets");
+        
 
 
         [Test]
         [Test]
         public void TestMaterialBuilderEquality()
         public void TestMaterialBuilderEquality()
         {
         {
-            var tex1Bytes = System.IO.File.ReadAllBytes(System.IO.Path.Combine(AssetsPath, "shannon.png"));
+            var tex1Bytes = System.IO.File.ReadAllBytes(ResourceInfo.From("shannon.png"));
 
 
             // create a material using our shared texture
             // create a material using our shared texture
             var material1 = new MaterialBuilder()
             var material1 = new MaterialBuilder()
@@ -62,8 +62,8 @@ namespace SharpGLTF.Materials
         {            
         {            
             TestContext.CurrentContext.AttachGltfValidatorLinks();            
             TestContext.CurrentContext.AttachGltfValidatorLinks();            
 
 
-            var tex1Bytes = System.IO.File.ReadAllBytes(System.IO.Path.Combine(AssetsPath, "shannon.png"));
-            var tex2Bytes = System.IO.File.ReadAllBytes(System.IO.Path.Combine(AssetsPath, "Texture1.jpg"));
+            var tex1Bytes = System.IO.File.ReadAllBytes(System.IO.Path.Combine(ResourceInfo.From("shannon.png")));
+            var tex2Bytes = System.IO.File.ReadAllBytes(System.IO.Path.Combine(ResourceInfo.From("Texture1.jpg")));
 
 
             var tex1 = AttachmentInfo
             var tex1 = AttachmentInfo
                 .From("shared-shannon.png")
                 .From("shared-shannon.png")

+ 11 - 16
tests/SharpGLTF.Toolkit.Tests/Materials/MaterialBuilderTests.cs

@@ -102,8 +102,7 @@ namespace SharpGLTF.Materials
 
 
         private static MaterialBuilder _CreateUnlitMaterial()
         private static MaterialBuilder _CreateUnlitMaterial()
         {
         {
-            var assetsPath = System.IO.Path.Combine(TestContext.CurrentContext.TestDirectory, "Assets");
-            var tex1 = System.IO.Path.Combine(assetsPath, "shannon.png");
+            var tex1 = ResourceInfo.From("shannon.png").FilePath;
 
 
             var material = new MaterialBuilder("Unlit Material")
             var material = new MaterialBuilder("Unlit Material")
                 .WithDoubleSide(true) // notice that DoubleSide enables double face rendering. This is an example, but it's usually NOT NECCESARY.
                 .WithDoubleSide(true) // notice that DoubleSide enables double face rendering. This is an example, but it's usually NOT NECCESARY.
@@ -117,8 +116,7 @@ namespace SharpGLTF.Materials
 
 
         private static MaterialBuilder _CreateMetallicRoughnessMaterial()
         private static MaterialBuilder _CreateMetallicRoughnessMaterial()
         {
         {
-            var assetsPath = System.IO.Path.Combine(TestContext.CurrentContext.TestDirectory, "Assets");
-            var tex1 = System.IO.Path.Combine(assetsPath, "shannon.png");
+            var tex1 = ResourceInfo.From("shannon.png").FilePath;
 
 
             var material = new MaterialBuilder("Metallic Roughness Material")
             var material = new MaterialBuilder("Metallic Roughness Material")
                 .WithAlpha(AlphaMode.MASK, 0.6f)
                 .WithAlpha(AlphaMode.MASK, 0.6f)
@@ -142,8 +140,7 @@ namespace SharpGLTF.Materials
 
 
         private static MaterialBuilder _CreateVolumeMaterial()
         private static MaterialBuilder _CreateVolumeMaterial()
         {
         {
-            var assetsPath = System.IO.Path.Combine(TestContext.CurrentContext.TestDirectory, "Assets");
-            var tex1 = System.IO.Path.Combine(assetsPath, "shannon.png");
+            var tex1 = ResourceInfo.From("shannon.png").FilePath;
 
 
             var material = new MaterialBuilder("Volume Material")
             var material = new MaterialBuilder("Volume Material")
                 .WithAlpha(AlphaMode.MASK, 0.6f);
                 .WithAlpha(AlphaMode.MASK, 0.6f);
@@ -160,8 +157,7 @@ namespace SharpGLTF.Materials
 
 
         private static MaterialBuilder _CreateIridescenceMaterial()
         private static MaterialBuilder _CreateIridescenceMaterial()
         {
         {
-            var assetsPath = System.IO.Path.Combine(TestContext.CurrentContext.TestDirectory, "Assets");
-            var tex1 = System.IO.Path.Combine(assetsPath, "shannon.png");
+            var tex1 = ResourceInfo.From("shannon.png").FilePath;
 
 
             var material = new MaterialBuilder("Volume Material")
             var material = new MaterialBuilder("Volume Material")
                 .WithAlpha(AlphaMode.OPAQUE);
                 .WithAlpha(AlphaMode.OPAQUE);
@@ -178,9 +174,8 @@ namespace SharpGLTF.Materials
         }
         }
 
 
         private static MaterialBuilder _CreateClearCoatMaterial()
         private static MaterialBuilder _CreateClearCoatMaterial()
-        {
-            var assetsPath = System.IO.Path.Combine(TestContext.CurrentContext.TestDirectory, "Assets");
-            var tex1 = System.IO.Path.Combine(assetsPath, "shannon.png");
+        {            
+            var tex1 = ResourceInfo.From("shannon.png").FilePath;
 
 
             var material = new MaterialBuilder("Clear Coat Material")
             var material = new MaterialBuilder("Clear Coat Material")
                 .WithAlpha(AlphaMode.MASK, 0.6f)
                 .WithAlpha(AlphaMode.MASK, 0.6f)
@@ -202,9 +197,9 @@ namespace SharpGLTF.Materials
         [Obsolete("SpecularGlossiness has been deprecated by Khronos")]
         [Obsolete("SpecularGlossiness has been deprecated by Khronos")]
         private static MaterialBuilder _CreateSpecularGlossinessMaterialWithFallback()
         private static MaterialBuilder _CreateSpecularGlossinessMaterialWithFallback()
         {
         {
-            var assetsPath = System.IO.Path.Combine(TestContext.CurrentContext.TestDirectory, "Assets");
-            var tex1 = System.IO.Path.Combine(assetsPath, "shannon.webp");
-            var tex2 = System.IO.Path.Combine(assetsPath, "shannon.png");
+            
+            var tex1 = ResourceInfo.From("shannon.webp").FilePath;
+            var tex2 = ResourceInfo.From("shannon.png").FilePath;
 
 
             var primary = new MaterialBuilder("primary")
             var primary = new MaterialBuilder("primary")
 
 
@@ -237,8 +232,8 @@ namespace SharpGLTF.Materials
         [Obsolete("SpecularGlossiness has been deprecated by Khronos")]
         [Obsolete("SpecularGlossiness has been deprecated by Khronos")]
         private static MaterialBuilder _CreateSpecularGlossinessMaterial()
         private static MaterialBuilder _CreateSpecularGlossinessMaterial()
         {
         {
-            var assetsPath = System.IO.Path.Combine(TestContext.CurrentContext.TestDirectory, "Assets");
-            var tex1 = System.IO.Path.Combine(assetsPath, "shannon.png");
+            
+            var tex1 = ResourceInfo.From("shannon.png").FilePath;
 
 
             var material = new MaterialBuilder()
             var material = new MaterialBuilder()
                 .WithAlpha(AlphaMode.MASK, 0.6f)
                 .WithAlpha(AlphaMode.MASK, 0.6f)

+ 4 - 6
tests/SharpGLTF.Toolkit.Tests/Properties/AssemblyInfo.cs

@@ -4,9 +4,7 @@ using System.Linq;
 using System.Text;
 using System.Text;
 using System.Threading.Tasks;
 using System.Threading.Tasks;
 
 
-namespace SharpGLTF.Properties
-{
-    internal class AssemblyInfo
-    {
-    }
-}
+using NUnit.Framework;
+
+[assembly: ResourcePathFormat("{SolutionDirectory}/tests/Assets")]
+[assembly: AttachmentPathFormat("*/TestResults/?", true)]

+ 5 - 3
tests/SharpGLTF.Toolkit.Tests/Scenes/SceneBuilderTests.cs

@@ -696,13 +696,15 @@ namespace SharpGLTF.Scenes
 
 
             var schema = sb.ToGltf2();
             var schema = sb.ToGltf2();
 
 
-            Assert.That(schema.LogicalMeshes.Count, Is.EqualTo(0), "SceneBuilder should detect empty meshes and remove them.");
+            Assert.That(schema.LogicalMeshes, Is.Empty, "SceneBuilder should detect empty meshes and remove them.");
 
 
             schema.CreateMesh("Empty2");
             schema.CreateMesh("Empty2");
 
 
-            var fileName = AttachmentInfo.From("empty.glb").File.FullName;
+            var file = AttachmentInfo.From("empty.glb").File;
 
 
-            Assert.Throws<SharpGLTF.Validation.SchemaException>(() => schema.SaveGLB(fileName));
+            file.Directory.Create();
+
+            Assert.Throws<SharpGLTF.Validation.SchemaException>(() => schema.SaveGLB(file.FullName));
         }
         }
 
 
         [Test]
         [Test]

+ 1 - 5
tests/SharpGLTF.Toolkit.Tests/SharpGLTF.Toolkit.Tests.csproj

@@ -5,11 +5,7 @@
     <IsPackable>false</IsPackable>
     <IsPackable>false</IsPackable>
     <RootNamespace>SharpGLTF</RootNamespace>
     <RootNamespace>SharpGLTF</RootNamespace>
     <LangVersion>latest</LangVersion>
     <LangVersion>latest</LangVersion>
-  </PropertyGroup>
-
-  <ItemGroup>
-    <Content Include="..\Assets\**" LinkBase="Assets" CopyToOutputDirectory="PreserveNewest" />
-  </ItemGroup>
+  </PropertyGroup>  
 
 
   <ItemGroup>
   <ItemGroup>
     <ProjectReference Include="..\SharpGLTF.NUnit\SharpGLTF.NUnit.csproj" />
     <ProjectReference Include="..\SharpGLTF.NUnit\SharpGLTF.NUnit.csproj" />