Forráskód Böngészése

Updated TestAttachment lib

Vicente Penades 3 éve
szülő
commit
d8b2f38db5

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

@@ -35,7 +35,7 @@ namespace SharpGLTF
 
             AttachmentInfo
                 .From(fileName)
-                .WriteObject(f => model.SaveAsWavefront(f.FullName, animation, time));
+                .WriteObject(f => model.SaveAsWavefront(f, 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)
-                    .WriteObject(f => model.SaveGLB(f.FullName, settings))
+                    .WriteObject(f => model.SaveGLB(f, settings))
                     .FullName;
             }
             else if (fileName.ToLowerInvariant().EndsWith(".gltf"))
@@ -70,7 +70,7 @@ namespace SharpGLTF
 
                 validationPath = fileName = AttachmentInfo
                     .From(fileName)
-                    .WriteObject(f => model.Save(f.FullName, settings))
+                    .WriteObject(f => model.Save(f, settings))
                     .FullName;
             }
             else if (fileName.ToLowerInvariant().EndsWith(".obj"))
@@ -82,7 +82,7 @@ namespace SharpGLTF
 
                 fileName = AttachmentInfo
                     .From(fileName)
-                    .WriteObject(f => model.SaveAsWavefront(f.FullName))
+                    .WriteObject(f => model.SaveAsWavefront(f))
                     .FullName;
             }
             else if (fileName.ToLowerInvariant().EndsWith(".plotly"))

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

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

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

@@ -10,8 +10,8 @@
   <ItemGroup>
     <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-20220704-1041" />
+    <PackageReference Include="GltfValidator" Version="2.0.0-dev.3.8.202205072307" />    
+    <PackageReference Include="TestAttachments.NUnit" Version="3.0.0-Preview-20220721-1621" />    
   </ItemGroup>
 
   <ItemGroup>    

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

@@ -95,11 +95,11 @@ namespace SharpGLTF.ThirdParty
 
             AttachmentInfo
                 .From("ColorMorphing.glb")
-                .WriteObject(f => model.Save(f.FullName));
+                .WriteObject(f => model.Save(f));
 
             AttachmentInfo
                 .From("ColorMorphing.gltf")
-                .WriteObject(f => model.Save(f.FullName));
+                .WriteObject(f => model.Save(f));
         }
 
         [Test]
@@ -173,11 +173,11 @@ namespace SharpGLTF.ThirdParty
 
             AttachmentInfo
                 .From("TextureMorphing.glb")
-                .WriteObject(f => model.Save(f.FullName));
+                .WriteObject(f => model.Save(f));
 
             AttachmentInfo
                 .From("TextureMorphing.gltf")
-                .WriteObject(f => model.Save(f.FullName));
+                .WriteObject(f => model.Save(f));
         }
 
         [Test]
@@ -254,11 +254,11 @@ namespace SharpGLTF.ThirdParty
 
             AttachmentInfo
                 .From("ColorAndTextureMorphing.glb")
-                .WriteObject(f => model.Save(f.FullName));
+                .WriteObject(f => model.Save(f));
 
             AttachmentInfo
                 .From("ColorAndTextureMorphing.gltf")
-                .WriteObject(f => model.Save(f.FullName));
+                .WriteObject(f => model.Save(f));
         }
     }
 }

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

@@ -54,11 +54,11 @@ namespace SharpGLTF.ThirdParty
 
             AttachmentInfo
                 .From("mesh.glb")
-                .WriteObject(f => scene.ToGltf2().Save(f.FullName));
+                .WriteObject(f => scene.ToGltf2().Save(f));
 
             AttachmentInfo
                 .From("mesh.gltf")
-                .WriteObject(f => scene.ToGltf2().Save(f.FullName));
+                .WriteObject(f => scene.ToGltf2().Save(f));
         }
 
     }

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

@@ -101,11 +101,11 @@ namespace SharpGLTF.ThirdParty
             // save the model in different formats
             AttachmentInfo
                 .From("ColorMorphingMultiPrim.glb")
-                .WriteObject(f => model.Save(f.FullName));
+                .WriteObject(f => model.Save(f));
 
             AttachmentInfo
                 .From("ColorMorphingMultiPrim.gltf")
-                .WriteObject(f => model.Save(f.FullName));
+                .WriteObject(f => model.Save(f));
 
             // save evaluated frames
 
@@ -115,7 +115,7 @@ namespace SharpGLTF.ThirdParty
             {
                 AttachmentInfo
                 .From($"ColorMorphingMultiPrim_{i}.obj")
-                .WriteObject(f => model.SaveAsWavefront(f.FullName, model.LogicalAnimations[0], (float)i / 5));
+                .WriteObject(f => model.SaveAsWavefront(f, model.LogicalAnimations[0], (float)i / 5));
             }
         }
     }

+ 2 - 2
tests/SharpGLTF.ThirdParty.Tests/SandboxTests.cs

@@ -139,10 +139,10 @@ namespace SharpGLTF.ThirdParty
 
             var fF= AttachmentInfo
                 .From("ColorMorphingMultiPrim.gltf")
-                .WriteObject(f => model.Save(f.FullName));
+                .WriteObject(f => model.Save(f));
 
             AttachmentInfo.From("ColorMorphingMultiPrim.glb")
-                .WriteObject(f => model.Save(f.FullName));
+                .WriteObject(f => model.Save(f));
             
         }
     }

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

@@ -14,8 +14,7 @@
   <ItemGroup>
     <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-20220704-1041" />    
+    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.2.0" />    
   </ItemGroup>
 
   <ItemGroup>