Jelajahi Sumber

Upgraded Unit tests to use NUnit 4.0.0

vpenades 2 tahun lalu
induk
melakukan
7ee134eeef
51 mengubah file dengan 687 tambahan dan 578 penghapusan
  1. 4 1
      SharpGLTF.sln
  2. 51 0
      tests/Directory.Build.props
  3. 2 2
      tests/SharpGLTF.Cesium.Tests/CesiumTests.cs
  4. 9 9
      tests/SharpGLTF.Cesium.Tests/ExtMeshFeaturesTests.cs
  5. 22 22
      tests/SharpGLTF.Core.Tests/Animations/AnimationSamplingTests.cs
  6. 18 18
      tests/SharpGLTF.Core.Tests/Collections/ChildrenListTests.cs
  7. 20 20
      tests/SharpGLTF.Core.Tests/Collections/VertexListTests.cs
  8. 3 3
      tests/SharpGLTF.Core.Tests/IO/JsonContentTests.cs
  9. 24 24
      tests/SharpGLTF.Core.Tests/InternalExtensionsTests.cs
  10. 9 9
      tests/SharpGLTF.Core.Tests/Memory/MemoryAccessorTests.cs
  11. 13 13
      tests/SharpGLTF.Core.Tests/Memory/MemoryArrayTests.cs
  12. 6 6
      tests/SharpGLTF.Core.Tests/Memory/MemoryImageTests.cs
  13. 6 6
      tests/SharpGLTF.Core.Tests/Schema2/Authoring/BasicSceneCreationTests.cs
  14. 4 4
      tests/SharpGLTF.Core.Tests/Schema2/Authoring/ExtensionsCreationTests.cs
  15. 1 1
      tests/SharpGLTF.Core.Tests/Schema2/LoadAndSave/LoadGeneratedTests.cs
  16. 1 1
      tests/SharpGLTF.Core.Tests/Schema2/LoadAndSave/LoadInvalidTests.cs
  17. 21 21
      tests/SharpGLTF.Core.Tests/Schema2/LoadAndSave/LoadSampleTests.cs
  18. 9 9
      tests/SharpGLTF.Core.Tests/Schema2/LoadAndSave/LoadSpecialModelsTest.cs
  19. 11 11
      tests/SharpGLTF.Core.Tests/Schema2/LoadAndSave/RegressionTests.cs
  20. 3 3
      tests/SharpGLTF.Core.Tests/Schema2/LoadAndSave/XmpJsonTests.cs
  21. 2 8
      tests/SharpGLTF.Core.Tests/SharpGLTF.Core.Tests.csproj
  22. 13 13
      tests/SharpGLTF.Core.Tests/Transforms/AffineTransformMatrixTests.cs
  23. 101 84
      tests/SharpGLTF.Core.Tests/Transforms/SparseWeight8Tests.cs
  24. 3 3
      tests/SharpGLTF.Core.Tests/Validation/InvalidFilesTests.cs
  25. 1 1
      tests/SharpGLTF.DownloadTestFiles/ExampleFiles.cs
  26. 2 2
      tests/SharpGLTF.NUnit/NUnitGltfUtils.cs
  27. 143 89
      tests/SharpGLTF.NUnit/NumericsAssert.cs
  28. 2 2
      tests/SharpGLTF.NUnit/SharpGLTF.NUnit.csproj
  29. 3 3
      tests/SharpGLTF.NUnit/TestFiles.cs
  30. 3 3
      tests/SharpGLTF.Runtime.Tests/Runtime/SceneTemplateTests.cs
  31. 2 7
      tests/SharpGLTF.Runtime.Tests/SharpGLTF.Runtime.Tests.csproj
  32. 12 12
      tests/SharpGLTF.ThirdParty.Tests/AceCebovTests.cs
  33. 6 6
      tests/SharpGLTF.ThirdParty.Tests/CesiumInstancingTests.cs
  34. 1 1
      tests/SharpGLTF.ThirdParty.Tests/EdMackeyTests.cs
  35. 2 2
      tests/SharpGLTF.ThirdParty.Tests/MeltyPlayerTests.cs
  36. 2 2
      tests/SharpGLTF.ThirdParty.Tests/PetarTasevTests.cs
  37. 6 6
      tests/SharpGLTF.ThirdParty.Tests/SandboxTests.cs
  38. 2 2
      tests/SharpGLTF.ThirdParty.Tests/SharpGLTF.ThirdParty.Tests.csproj
  39. 3 3
      tests/SharpGLTF.ThirdParty.Tests/SteamDbTests.cs
  40. 10 10
      tests/SharpGLTF.Toolkit.Tests/Animations/CurveBuilderTests.cs
  41. 6 6
      tests/SharpGLTF.Toolkit.Tests/Geometry/MeshBuilderAdvancedTests.cs
  42. 38 38
      tests/SharpGLTF.Toolkit.Tests/Geometry/MeshBuilderTests.cs
  43. 2 2
      tests/SharpGLTF.Toolkit.Tests/Geometry/VertexTypes/CustomVertexTests.cs
  44. 10 10
      tests/SharpGLTF.Toolkit.Tests/Geometry/VertexTypes/VertexSkinningTests.cs
  45. 1 1
      tests/SharpGLTF.Toolkit.Tests/IO/WavefrontWriterTest.cs
  46. 4 4
      tests/SharpGLTF.Toolkit.Tests/IO/ZipTests.cs
  47. 12 12
      tests/SharpGLTF.Toolkit.Tests/Materials/ContentSharingTests.cs
  48. 17 17
      tests/SharpGLTF.Toolkit.Tests/Materials/MaterialBuilderTests.cs
  49. 1 1
      tests/SharpGLTF.Toolkit.Tests/Materials/MaterialTypesTests.cs
  50. 37 37
      tests/SharpGLTF.Toolkit.Tests/Scenes/SceneBuilderTests.cs
  51. 3 8
      tests/SharpGLTF.Toolkit.Tests/SharpGLTF.Toolkit.Tests.csproj

+ 4 - 1
SharpGLTF.sln

@@ -16,6 +16,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{072B725F-773
 	EndProjectSection
 EndProject
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{0CBF510D-D836-40BA-95EC-E93FDBB90632}"
+	ProjectSection(SolutionItems) = preProject
+		tests\Directory.Build.props = tests\Directory.Build.props
+	EndProjectSection
 EndProject
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SharpGLTF.CodeGen", "build\SharpGLTF.CodeGen\SharpGLTF.CodeGen.csproj", "{E15F8DCC-987D-4FA8-B7B0-1F0614DC93DD}"
 EndProject
@@ -60,7 +63,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SharpGLTF.Cesium", "src\Sha
 EndProject
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SharpGLTF.Cesium.Tests", "tests\SharpGLTF.Cesium.Tests\SharpGLTF.Cesium.Tests.csproj", "{94011062-791E-4D34-ACA8-09AAAD49B299}"
 EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpGLTF.Agi", "src\SharpGLTF.Agi\SharpGLTF.Agi.csproj", "{6BEBBB6A-932F-4AF2-B1D9-3B533BE2C8F3}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SharpGLTF.Agi", "src\SharpGLTF.Agi\SharpGLTF.Agi.csproj", "{6BEBBB6A-932F-4AF2-B1D9-3B533BE2C8F3}"
 EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution

+ 51 - 0
tests/Directory.Build.props

@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project>
+
+  <!-- Legal =================================================================================== -->
+
+  <PropertyGroup>
+    <Authors>Vicente Penades</Authors>    
+    <Copyright>Copyright (c) 2023 Vicente Penades</Copyright>
+    <Description>SharpGLTF is a C# library for reading and writing glTF2 3D models</Description>    
+  </PropertyGroup>  
+
+  <!-- Configuration =================================================================================== -->
+
+  <PropertyGroup>
+    <LangVersion>8.0</LangVersion>
+    <IsPackable>false</IsPackable>
+  </PropertyGroup>  
+  
+  <!-- Testing & Analysers =================================================================================== -->  
+
+  <PropertyGroup>
+    <NoWarn>1701;1702;1591;CA1062;CA1304;CA1310;CA1000;CA5394;CA1510;CA1512</NoWarn>
+  </PropertyGroup>  
+
+  <PropertyGroup>
+    <!-- Enable all FxCop rules with NetAnalyzers
+    https://docs.microsoft.com/es-es/visualstudio/code-quality/migrate-from-fxcop-analyzers-to-net-analyzers?view=vs-2022#migration-steps
+    -->
+    
+    <AnalysisMode>AllEnabledByDefault</AnalysisMode>
+    <!-- <CodeAnalysisRuleSet>$(MsBuildThisFileDirectory)..\solution.ruleset</CodeAnalysisRuleSet>  -->  
+    
+  </PropertyGroup>
+
+  <ItemGroup>
+    
+    <AdditionalFiles Include="$(MsBuildThisFileDirectory)..\stylecop.json" />
+    
+    <PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="8.0.0">
+      <PrivateAssets>all</PrivateAssets>
+      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
+    </PackageReference>
+
+    <PackageReference Include="NUnit.Analyzers" Version="3.10.0">
+      <PrivateAssets>all</PrivateAssets>
+      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
+    </PackageReference>
+
+  </ItemGroup>
+  
+</Project>

+ 2 - 2
tests/SharpGLTF.Cesium.Tests/CesiumTests.cs

@@ -46,8 +46,8 @@ namespace SharpGLTF
             model.LogicalMeshes[0].Primitives[0].SetCesiumOutline(outlines);
 
             var cesiumOutlineExtension = (CesiumPrimitiveOutline)model.LogicalMeshes[0].Primitives[0].Extensions.FirstOrDefault();
-            Assert.NotNull(cesiumOutlineExtension.Indices);
-            CollectionAssert.AreEqual(outlines, cesiumOutlineExtension.Indices.AsIndicesArray());
+            Assert.That(cesiumOutlineExtension.Indices, Is.Not.Null);            
+            Assert.That(outlines, Is.EqualTo(cesiumOutlineExtension.Indices.AsIndicesArray()));
 
             var ctx = new ValidationResult(model, ValidationMode.Strict, true);
             model.ValidateContent(ctx.GetContext());

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

@@ -54,18 +54,18 @@ namespace SharpGLTF.Cesium
 
             // Validate the FeatureIds
             var cesiumExtMeshFeaturesExtension = (MeshExtMeshFeatures)model.LogicalMeshes[0].Primitives[0].Extensions.FirstOrDefault();
-            Assert.NotNull(cesiumExtMeshFeaturesExtension.FeatureIds);
+            Assert.That(cesiumExtMeshFeaturesExtension.FeatureIds, Is.Not.Null);
 
-            Assert.IsTrue(cesiumExtMeshFeaturesExtension.FeatureIds.Equals(featureIds));
+            Assert.That(cesiumExtMeshFeaturesExtension.FeatureIds.Equals(featureIds));
 
             // Check there should be a custom vertex attribute with name _FEATURE_ID_{attribute}
             var attribute = cesiumExtMeshFeaturesExtension.FeatureIds[0].Attribute;
-            Assert.IsTrue(attribute == 0);
+            Assert.That(attribute == 0);
             var primitive = model.LogicalMeshes[0].Primitives[0];
             var featureIdVertexAccessor = primitive.GetVertexAccessor($"_FEATURE_ID_{attribute}");
-            Assert.NotNull(featureIdVertexAccessor);
+            Assert.That(featureIdVertexAccessor, Is.Not.Null);
             var items = featureIdVertexAccessor.AsScalarArray();
-            Assert.AreEqual(items, new List<int> { featureId, featureId, featureId });
+            Assert.That(items, Is.EqualTo(new List<int> { featureId, featureId, featureId }));
 
             var ctx = new ValidationResult(model, ValidationMode.Strict, true);
 
@@ -117,15 +117,15 @@ namespace SharpGLTF.Cesium
             primitive.SetFeatureIds(featureIds);
 
             var cesiumExtMeshFeaturesExtension = (MeshExtMeshFeatures)primitive.Extensions.FirstOrDefault();
-            Assert.NotNull(cesiumExtMeshFeaturesExtension.FeatureIds);
+            Assert.That(cesiumExtMeshFeaturesExtension.FeatureIds, Is.Not.Null);
 
-            Assert.IsTrue(cesiumExtMeshFeaturesExtension.FeatureIds.Equals(featureIds));
+            Assert.That(cesiumExtMeshFeaturesExtension.FeatureIds, Is.EqualTo(featureIds));
             var featureId = cesiumExtMeshFeaturesExtension.FeatureIds[0];
             var texCoord = featureId.Texture.TextureCoordinate;
 
             var textureIdVertexAccessor = primitive.GetVertexAccessor($"TEXCOORD_{texCoord}");
-            Assert.NotNull(textureIdVertexAccessor);
-            Assert.IsTrue(textureIdVertexAccessor.AsVector2Array().Count == 4);
+            Assert.That(textureIdVertexAccessor, Is.Not.Null);
+            Assert.That(textureIdVertexAccessor.AsVector2Array(), Has.Count.EqualTo(4));
 
             var ctx = new ValidationResult(model, ValidationMode.Strict, true);
 

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

@@ -49,35 +49,35 @@ namespace SharpGLTF
             void checkSegment(int time, (float,int)[] segment)
             {
                 // should check all times are incremental
-                Assert.Greater(segment.Length, 1);
-                Assert.LessOrEqual(segment.First().Item1, time);
-                Assert.Greater(segment.Last().Item1, time);
+                Assert.That(segment.Length, Is.GreaterThan(1));
+                Assert.That(segment.First().Item1, Is.LessThanOrEqualTo(time));
+                Assert.That(segment.Last().Item1, Is.GreaterThan(time));
             }
 
 
             var r0 = Animations.CurveSampler.SplitByTime(anim0).ToArray();
-            Assert.AreEqual(1, r0.Length);
-            Assert.AreEqual(1, r0[0].Length);
+            Assert.That(r0, Has.Length.EqualTo(1));
+            Assert.That(r0[0], Has.Length.EqualTo(1));
 
             var r1 = Animations.CurveSampler.SplitByTime(anim1).ToArray();
-            Assert.AreEqual(1, r1.Length);
-            Assert.AreEqual(2, r1[0].Length);
+            Assert.That(r1, Has.Length.EqualTo(1));
+            Assert.That(r1[0], Has.Length.EqualTo(2));
 
             var r2 = Animations.CurveSampler.SplitByTime(anim2).ToArray();
-            Assert.AreEqual(4, r2.Length);
-            Assert.AreEqual(3, r2[0].Length); 
-            Assert.AreEqual(2, r2[1].Length); checkSegment(1, r2[1]);
-            Assert.AreEqual(2, r2[2].Length); checkSegment(2, r2[2]);
-            Assert.AreEqual(3, r2[3].Length); checkSegment(3, r2[3]);
+            Assert.That(r2, Has.Length.EqualTo(4));
+            Assert.That(r2[0], Has.Length.EqualTo(3)); 
+            Assert.That(r2[1], Has.Length.EqualTo(2)); checkSegment(1, r2[1]);
+            Assert.That(r2[2], Has.Length.EqualTo(2)); checkSegment(2, r2[2]);
+            Assert.That(r2[3], Has.Length.EqualTo(3)); checkSegment(3, r2[3]);
 
             var r3 = Animations.CurveSampler.SplitByTime(anim3).ToArray();
-            Assert.AreEqual(6, r3.Length);
-            Assert.AreEqual(1, r3[0].Length); 
-            Assert.AreEqual(1, r3[1].Length); 
-            Assert.AreEqual(3, r3[2].Length); 
-            Assert.AreEqual(4, r3[3].Length); checkSegment(3, r3[3]);
-            Assert.AreEqual(4, r3[3].Length); checkSegment(4, r3[4]);
-            Assert.AreEqual(1, r3[5].Length);
+            Assert.That(r3, Has.Length.EqualTo(6));
+            Assert.That(r3[0], Has.Length.EqualTo(1)); 
+            Assert.That(r3[1], Has.Length.EqualTo(1)); 
+            Assert.That(r3[2], Has.Length.EqualTo(3)); 
+            Assert.That(r3[3], Has.Length.EqualTo(4)); checkSegment(3, r3[3]);
+            Assert.That(r3[3], Has.Length.EqualTo(4)); checkSegment(4, r3[4]);
+            Assert.That(r3[5], Has.Length.EqualTo(1));
         }
 
         [Test]
@@ -93,8 +93,8 @@ namespace SharpGLTF
 
             foreach (var k in curve)
             {
-                Assert.AreEqual(k.Item2, slowSampler.GetPoint(k.Item1));
-                Assert.AreEqual(k.Item2, fastSampler.GetPoint(k.Item1));
+                Assert.That(slowSampler.GetPoint(k.Item1), Is.EqualTo(k.Item2));
+                Assert.That(fastSampler.GetPoint(k.Item1), Is.EqualTo(k.Item2));
             }
 
             for(float t=0; t < 100; t+=0.232f)
@@ -102,7 +102,7 @@ namespace SharpGLTF
                 var dv = slowSampler.GetPoint(t);
                 var fv = fastSampler.GetPoint(t);
 
-                Assert.AreEqual(dv, fv);
+                Assert.That(fv, Is.EqualTo(dv));
             }
         }
 

+ 18 - 18
tests/SharpGLTF.Core.Tests/Collections/ChildrenListTests.cs

@@ -33,38 +33,38 @@ namespace SharpGLTF.Collections
             Assert.Throws<ArgumentNullException>(() => list.Add(null));
 
             var item1 = new TestChild();
-            Assert.IsNull(item1.LogicalParent);
-            Assert.AreEqual(-1, item1.LogicalIndex);
+            Assert.That(item1.LogicalParent, Is.Null);
+            Assert.That(item1.LogicalIndex, Is.EqualTo(-1));
 
             var item2 = new TestChild();
-            Assert.IsNull(item2.LogicalParent);
-            Assert.AreEqual(-1, item2.LogicalIndex);
+            Assert.That(item2.LogicalParent, Is.Null);
+            Assert.That(item2.LogicalIndex, Is.EqualTo(-1));
 
             list.Add(item1);
-            Assert.AreSame(this, item1.LogicalParent);
-            Assert.AreEqual(0, item1.LogicalIndex);
+            Assert.That(item1.LogicalParent, Is.SameAs(this));
+            Assert.That(item1.LogicalIndex, Is.EqualTo(0));
 
             Assert.Throws<ArgumentException>(() => list.Add(item1));
 
             list.Remove(item1);
-            Assert.IsNull(item1.LogicalParent);
-            Assert.AreEqual(-1, item1.LogicalIndex);
+            Assert.That(item1.LogicalParent, Is.Null);
+            Assert.That(item1.LogicalIndex, Is.EqualTo(-1));
 
             list.Add(item1);
-            Assert.AreSame(this, item1.LogicalParent);
-            Assert.AreEqual(0, item1.LogicalIndex);
+            Assert.That(item1.LogicalParent, Is.SameAs(this));
+            Assert.That(item1.LogicalIndex, Is.EqualTo(0));
 
             list.Insert(0, item2);
-            Assert.AreSame(this, item2.LogicalParent);
-            Assert.AreEqual(0, item2.LogicalIndex);
-            Assert.AreSame(this, item1.LogicalParent);
-            Assert.AreEqual(1, item1.LogicalIndex);
+            Assert.That(item2.LogicalParent, Is.SameAs(this));
+            Assert.That(item2.LogicalIndex, Is.EqualTo(0));
+            Assert.That(item1.LogicalParent, Is.SameAs(this));
+            Assert.That(item1.LogicalIndex, Is.EqualTo(1));
 
             list.RemoveAt(0);
-            Assert.IsNull(item2.LogicalParent);
-            Assert.AreEqual(-1, item2.LogicalIndex);
-            Assert.AreSame(this, item1.LogicalParent);
-            Assert.AreEqual(0, item1.LogicalIndex);
+            Assert.That(item2.LogicalParent, Is.Null);
+            Assert.That(item2.LogicalIndex, Is.EqualTo(-1));
+            Assert.That(item1.LogicalParent, Is.SameAs(this));
+            Assert.That(item1.LogicalIndex, Is.EqualTo(0));
 
         }
 

+ 20 - 20
tests/SharpGLTF.Core.Tests/Collections/VertexListTests.cs

@@ -23,11 +23,11 @@ namespace SharpGLTF.Collections
 
             var floats = new float[] { positiveZero, negativeZero };
             var integers = System.Runtime.InteropServices.MemoryMarshal.Cast<float, uint>(floats);
-            Assert.AreNotEqual(integers[0], integers[1]);
+            Assert.That(integers[1], Is.Not.EqualTo(integers[0]));
 
             var positiveHash = positiveZero.GetHashCode();
             var negativeHash = negativeZero.GetHashCode();
-            Assert.AreEqual(positiveHash, negativeHash);
+            Assert.That(negativeHash, Is.EqualTo(positiveHash));
         }
 
         [System.Diagnostics.DebuggerDisplay("{Value}")]
@@ -52,19 +52,19 @@ namespace SharpGLTF.Collections
             var list = new VertexList<_VertexExample>();
 
             list.Use(5);
-            Assert.AreEqual(1, list.Count);
+            Assert.That(list, Has.Count.EqualTo(1));
 
             list.Use(7);
-            Assert.AreEqual(2, list.Count);
-            Assert.AreEqual(5, list[0].Value);
-            Assert.AreEqual(7, list[1].Value);
+            Assert.That(list, Has.Count.EqualTo(2));
+            Assert.That(list[0].Value, Is.EqualTo(5));
+            Assert.That(list[1].Value, Is.EqualTo(7));
 
             list.Use(5);
-            Assert.AreEqual(2, list.Count);
+            Assert.That(list, Has.Count.EqualTo(2));
 
             var list2 = new VertexList<_VertexExample>();
             list.CopyTo(list2);
-            Assert.AreEqual(2, list2.Count);
+            Assert.That(list2, Has.Count.EqualTo(2));
 
         }
 
@@ -78,27 +78,27 @@ namespace SharpGLTF.Collections
 
             var vlist = new ValueListSet<XYZ>();
 
-            var idx0 = vlist.Use(a); Assert.AreEqual(0, idx0);
-            var idx1 = vlist.Use(b); Assert.AreEqual(1, idx1);
-            var idx2 = vlist.Use(a); Assert.AreEqual(0, idx2);
+            var idx0 = vlist.Use(a); Assert.That(idx0, Is.EqualTo(0));
+            var idx1 = vlist.Use(b); Assert.That(idx1, Is.EqualTo(1));
+            var idx2 = vlist.Use(a); Assert.That(idx2, Is.EqualTo(0));
 
-            Assert.AreEqual(a, vlist[idx0]);
-            Assert.AreEqual(b, vlist[idx1]);
-            Assert.AreEqual(a, vlist[idx2]);
+            Assert.That(vlist[idx0], Is.EqualTo(a));
+            Assert.That(vlist[idx1], Is.EqualTo(b));
+            Assert.That(vlist[idx2], Is.EqualTo(a));
 
-            CollectionAssert.AreEqual(new[] { a, b }, vlist.ToArray());
+            Assert.That(new[] { a, b }, Is.EqualTo(vlist.ToArray()));
 
             vlist.Use(c);
             vlist.Use(d);
-            CollectionAssert.AreEqual(new[] { a, b, c, d }, vlist.ToArray());
+            Assert.That(new[] { a, b, c, d }, Is.EqualTo(vlist.ToArray()));
 
             var vlist2 = new ValueListSet<XYZ>();
             vlist.CopyTo(vlist2);
 
-            Assert.AreEqual(vlist[0], vlist2[0]);
-            Assert.AreEqual(vlist[1], vlist2[1]);
-            Assert.AreEqual(vlist[2], vlist2[2]);
-            Assert.AreEqual(vlist[3], vlist2[3]);
+            Assert.That(vlist2[0], Is.EqualTo(vlist[0]));
+            Assert.That(vlist2[1], Is.EqualTo(vlist[1]));
+            Assert.That(vlist2[2], Is.EqualTo(vlist[2]));
+            Assert.That(vlist2[3], Is.EqualTo(vlist[3]));
 
         }
 

+ 3 - 3
tests/SharpGLTF.Core.Tests/IO/JsonContentTests.cs

@@ -196,12 +196,12 @@ namespace SharpGLTF.IO
 
             TestContext.WriteLine(roundtripJson);
 
-            Assert.IsTrue(roundtripJson.Contains("你好"));
+            Assert.That(roundtripJson, Does.Contain("你好"));
             
             // https://github.com/KhronosGroup/glTF/issues/1978#issuecomment-831744624
-            Assert.IsTrue(roundtripJson.Contains("extended%20%E4%BD%A0%E5%A5%BD%20characters.png"));
+            Assert.That(roundtripJson, Does.Contain("extended%20%E4%BD%A0%E5%A5%BD%20characters.png"));
 
-            Assert.IsTrue(roundtripModel.LogicalImages[0].Content.IsPng);
+            Assert.That(roundtripModel.LogicalImages[0].Content.IsPng, Is.True);
         }
     }    
 }

+ 24 - 24
tests/SharpGLTF.Core.Tests/InternalExtensionsTests.cs

@@ -26,11 +26,11 @@ namespace SharpGLTF
         [Test]
         public void TestPadding()
         {
-            Assert.AreEqual(4, _WordPadded(1));
-            Assert.AreEqual(4, _WordPadded(2));
-            Assert.AreEqual(4, _WordPadded(3));
-            Assert.AreEqual(4, _WordPadded(4));
-            Assert.AreEqual(8, _WordPadded(5));
+            Assert.That(_WordPadded(1), Is.EqualTo(4));
+            Assert.That(_WordPadded(2), Is.EqualTo(4));
+            Assert.That(_WordPadded(3), Is.EqualTo(4));
+            Assert.That(_WordPadded(4), Is.EqualTo(4));
+            Assert.That(_WordPadded(5), Is.EqualTo(8));
         }
 
         [Test]
@@ -40,35 +40,35 @@ namespace SharpGLTF
             // they should default to null regardless of the value being inside or outside the bounds of min-max
             // but if after the min.max has affected the value, the default-to-null check still applies.
 
-            Assert.AreEqual(null, 5.AsNullable(5));
+            Assert.That(5.AsNullable(5), Is.EqualTo(null));
 
-            Assert.AreEqual(1,    0.AsNullable(3, 1, 5));
-            Assert.AreEqual(1,    1.AsNullable(3, 1, 5));
-            Assert.AreEqual(2,    2.AsNullable(3, 1, 5));
-            Assert.AreEqual(null, 3.AsNullable(3, 1, 5));
-            Assert.AreEqual(4,    4.AsNullable(3, 1, 5));
-            Assert.AreEqual(5,    5.AsNullable(3, 1, 5));
-            Assert.AreEqual(5,    6.AsNullable(3, 1, 5));            
+            Assert.That(0.AsNullable(3, 1, 5), Is.EqualTo(1));
+            Assert.That(1.AsNullable(3, 1, 5), Is.EqualTo(1));
+            Assert.That(2.AsNullable(3, 1, 5), Is.EqualTo(2));
+            Assert.That(3.AsNullable(3, 1, 5), Is.EqualTo(null));
+            Assert.That(4.AsNullable(3, 1, 5), Is.EqualTo(4));
+            Assert.That(5.AsNullable(3, 1, 5), Is.EqualTo(5));
+            Assert.That(6.AsNullable(3, 1, 5), Is.EqualTo(5));            
 
             // vectors
 
-            Assert.AreEqual(null, Vector2.Zero.AsNullable(Vector2.One, Vector2.One, Vector2.One * 2));
-            Assert.AreEqual(new Vector2(2), new Vector2(3).AsNullable(Vector2.One, Vector2.One, Vector2.One * 2));
+            Assert.That(Vector2.Zero.AsNullable(Vector2.One, Vector2.One, Vector2.One * 2), Is.EqualTo(null));
+            Assert.That(new Vector2(3).AsNullable(Vector2.One, Vector2.One, Vector2.One * 2), Is.EqualTo(new Vector2(2)));
 
-            Assert.AreEqual(null, Vector3.Zero.AsNullable(Vector3.One, Vector3.One, Vector3.One * 2));
-            Assert.AreEqual(new Vector3(2), new Vector3(3).AsNullable(Vector3.One, Vector3.One, Vector3.One * 2));
+            Assert.That(Vector3.Zero.AsNullable(Vector3.One, Vector3.One, Vector3.One * 2), Is.EqualTo(null));
+            Assert.That(new Vector3(3).AsNullable(Vector3.One, Vector3.One, Vector3.One * 2), Is.EqualTo(new Vector3(2)));
 
-            Assert.AreEqual(null, Vector4.Zero.AsNullable(Vector4.One, Vector4.One, Vector4.One * 2));
-            Assert.AreEqual(new Vector4(2), new Vector4(3).AsNullable(Vector4.One, Vector4.One, Vector4.One * 2));
+            Assert.That(Vector4.Zero.AsNullable(Vector4.One, Vector4.One, Vector4.One * 2), Is.EqualTo(null));
+            Assert.That(new Vector4(3).AsNullable(Vector4.One, Vector4.One, Vector4.One * 2), Is.EqualTo(new Vector4(2)));
 
 
             // special case: default values outside the min-max range should also return null
-            Assert.AreEqual(null,  0.AsNullable( 0, 1, 5));
-            Assert.AreEqual(null, 10.AsNullable(10, 1, 5));
+            Assert.That(0.AsNullable( 0, 1, 5), Is.EqualTo(null));
+            Assert.That(10.AsNullable(10, 1, 5), Is.EqualTo(null));
 
-            Assert.AreEqual(null, Vector2.Zero.AsNullable(Vector2.Zero, Vector2.One, Vector2.One * 5));
-            Assert.AreEqual(null, Vector3.Zero.AsNullable(Vector3.Zero, Vector3.One, Vector3.One * 5));
-            Assert.AreEqual(null, Vector4.Zero.AsNullable(Vector4.Zero, Vector4.One, Vector4.One * 5));
+            Assert.That(Vector2.Zero.AsNullable(Vector2.Zero, Vector2.One, Vector2.One * 5), Is.EqualTo(null));
+            Assert.That(Vector3.Zero.AsNullable(Vector3.Zero, Vector3.One, Vector3.One * 5), Is.EqualTo(null));
+            Assert.That(Vector4.Zero.AsNullable(Vector4.Zero, Vector4.One, Vector4.One * 5), Is.EqualTo(null));
         }        
     }
 }

+ 9 - 9
tests/SharpGLTF.Core.Tests/Memory/MemoryAccessorTests.cs

@@ -25,18 +25,18 @@ namespace SharpGLTF.Memory
             pos = attributes[0];
             nrm = attributes[1];
 
-            Assert.AreEqual(24, byteStride);
+            Assert.That(byteStride, Is.EqualTo(24));
 
-            Assert.AreEqual(baseOffset + 0, pos.ByteOffset);
-            Assert.AreEqual(24, pos.ByteStride);
-            Assert.AreEqual(5, pos.ItemsCount);
+            Assert.That(pos.ByteOffset, Is.EqualTo(baseOffset + 0));
+            Assert.That(pos.ByteStride, Is.EqualTo(24));
+            Assert.That(pos.ItemsCount, Is.EqualTo(5));
 
-            Assert.AreEqual(baseOffset + 12, nrm.ByteOffset);
-            Assert.AreEqual(24, nrm.ByteStride);
-            Assert.AreEqual(5, nrm.ItemsCount);
+            Assert.That(nrm.ByteOffset, Is.EqualTo(baseOffset + 12));
+            Assert.That(nrm.ByteStride, Is.EqualTo(24));
+            Assert.That(nrm.ItemsCount, Is.EqualTo(5));
 
-            Assert.IsTrue(pos.IsValidVertexAttribute);
-            Assert.IsTrue(nrm.IsValidVertexAttribute);
+            Assert.That(pos.IsValidVertexAttribute, Is.True);
+            Assert.That(nrm.IsValidVertexAttribute, Is.True);
         }
     }
 }

+ 13 - 13
tests/SharpGLTF.Core.Tests/Memory/MemoryArrayTests.cs

@@ -13,22 +13,22 @@ namespace SharpGLTF.Memory
         [Test]
         public void TestFloatingArrayDecoding()
         {
-            Assert.AreEqual(17, _CreateFloatingAccessor(new Byte[] { 17 }, Schema2.EncodingType.UNSIGNED_BYTE, false)[0]);
-            Assert.AreEqual(17, _CreateFloatingAccessor(new Byte[] { 17, 0 }, Schema2.EncodingType.UNSIGNED_SHORT, false)[0]);            
+            Assert.That(_CreateFloatingAccessor(new Byte[] { 17 }, Schema2.EncodingType.UNSIGNED_BYTE, false)[0], Is.EqualTo(17));
+            Assert.That(_CreateFloatingAccessor(new Byte[] { 17, 0 }, Schema2.EncodingType.UNSIGNED_SHORT, false)[0], Is.EqualTo(17));            
 
-            Assert.AreEqual(17, _CreateFloatingAccessor(new Byte[] { 17 }, Schema2.EncodingType.BYTE, false)[0]);
-            Assert.AreEqual(17, _CreateFloatingAccessor(new Byte[] { 17, 0 }, Schema2.EncodingType.SHORT, false)[0]);
+            Assert.That(_CreateFloatingAccessor(new Byte[] { 17 }, Schema2.EncodingType.BYTE, false)[0], Is.EqualTo(17));
+            Assert.That(_CreateFloatingAccessor(new Byte[] { 17, 0 }, Schema2.EncodingType.SHORT, false)[0], Is.EqualTo(17));
 
-            Assert.AreEqual(1, _CreateFloatingAccessor(new Byte[] { 255 }, Schema2.EncodingType.UNSIGNED_BYTE, true)[0]);
-            Assert.AreEqual(1, _CreateFloatingAccessor(new Byte[] { 127 }, Schema2.EncodingType.BYTE, true)[0]);
-            Assert.AreEqual(-1, _CreateFloatingAccessor(new Byte[] { 128 }, Schema2.EncodingType.BYTE, true)[0]);
+            Assert.That(_CreateFloatingAccessor(new Byte[] { 255 }, Schema2.EncodingType.UNSIGNED_BYTE, true)[0], Is.EqualTo(1));
+            Assert.That(_CreateFloatingAccessor(new Byte[] { 127 }, Schema2.EncodingType.BYTE, true)[0], Is.EqualTo(1));
+            Assert.That(_CreateFloatingAccessor(new Byte[] { 128 }, Schema2.EncodingType.BYTE, true)[0], Is.EqualTo(-1));
 
-            Assert.AreEqual(1, _CreateFloatingAccessor(new Byte[] { 255, 255 }, Schema2.EncodingType.UNSIGNED_SHORT, true)[0]);
-            Assert.AreEqual(1, _CreateFloatingAccessor(new Byte[] { 255, 127 }, Schema2.EncodingType.SHORT, true)[0]);
-            Assert.AreEqual(-1, _CreateFloatingAccessor(new Byte[] { 0,  128 }, Schema2.EncodingType.SHORT, true)[0]);
+            Assert.That(_CreateFloatingAccessor(new Byte[] { 255, 255 }, Schema2.EncodingType.UNSIGNED_SHORT, true)[0], Is.EqualTo(1));
+            Assert.That(_CreateFloatingAccessor(new Byte[] { 255, 127 }, Schema2.EncodingType.SHORT, true)[0], Is.EqualTo(1));
+            Assert.That(_CreateFloatingAccessor(new Byte[] { 0,  128 }, Schema2.EncodingType.SHORT, true)[0], Is.EqualTo(-1));
 
-            Assert.AreEqual(17, _CreateFloatingAccessor(new Byte[] { 17, 0, 0, 0 }, Schema2.EncodingType.UNSIGNED_INT, false)[0]);
-            Assert.AreEqual(1, _CreateFloatingAccessor(new Byte[] { 0,0, 0x80, 0x3f }, Schema2.EncodingType.FLOAT, false)[0]);
+            Assert.That(_CreateFloatingAccessor(new Byte[] { 17, 0, 0, 0 }, Schema2.EncodingType.UNSIGNED_INT, false)[0], Is.EqualTo(17));
+            Assert.That(_CreateFloatingAccessor(new Byte[] { 0,0, 0x80, 0x3f }, Schema2.EncodingType.FLOAT, false)[0], Is.EqualTo(1));
         }
 
         private static FloatingAccessor _CreateFloatingAccessor(byte[] data, Schema2.EncodingType encoding, bool normalized)
@@ -81,7 +81,7 @@ namespace SharpGLTF.Memory
 
             var result = accessor.ToArray();
 
-            Assert.AreEqual(3, result.Length);
+            Assert.That(result, Has.Length.EqualTo(3));
         }
     }
 }

+ 6 - 6
tests/SharpGLTF.Core.Tests/Memory/MemoryImageTests.cs

@@ -19,13 +19,13 @@ namespace SharpGLTF.Memory
             var image2 = new MemoryImage(MemoryImage.DefaultPngImage, "second_reference.png");
             var image3 = MemoryImage.Empty;
 
-            Assert.AreEqual(image1.GetHashCode(), image2.GetHashCode());
-            Assert.AreEqual(image1, image2);
-            Assert.IsTrue(MemoryImage.AreEqual(image1, image2));
+            Assert.That(image2.GetHashCode(), Is.EqualTo(image1.GetHashCode()));
+            Assert.That(image2, Is.EqualTo(image1));
+            Assert.That(MemoryImage.AreEqual(image1, image2), Is.True);
 
-            Assert.AreNotEqual(image1.GetHashCode(), image3.GetHashCode());
-            Assert.AreNotEqual(image1, image3);
-            Assert.IsFalse(MemoryImage.AreEqual(image1, image3));
+            Assert.That(image3.GetHashCode(), Is.Not.EqualTo(image1.GetHashCode()));
+            Assert.That(image3, Is.Not.EqualTo(image1));
+            Assert.That(MemoryImage.AreEqual(image1, image3), Is.False);
         }
     }
 }

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

@@ -23,8 +23,8 @@ namespace SharpGLTF.Schema2.Authoring
 
             var scene = root.UseScene("Empty Scene");
 
-            Assert.NotNull(scene);
-            Assert.AreEqual("Empty Scene", root.DefaultScene.Name);
+            Assert.That(scene, Is.Not.Null);
+            Assert.That(root.DefaultScene.Name, Is.EqualTo("Empty Scene"));
         }
 
         [Test(Description = "Creates an empty model")]
@@ -62,10 +62,10 @@ namespace SharpGLTF.Schema2.Authoring
             var json = rootBis.Extras.ToJsonString();
             var c = JSONEXTRAS.Parse(json);
 
-            Assert.IsTrue(JsonContentTests.AreEqual(a, b));
-            Assert.IsTrue(JsonContentTests.AreEqual(a, extras));
-            Assert.IsTrue(JsonContentTests.AreEqual(b, extras));
-            Assert.IsTrue(JsonContentTests.AreEqual(c, extras));
+            Assert.That(JsonContentTests.AreEqual(a, b), Is.True);
+            Assert.That(JsonContentTests.AreEqual(a, extras), Is.True);
+            Assert.That(JsonContentTests.AreEqual(b, extras), Is.True);
+            Assert.That(JsonContentTests.AreEqual(c, extras), Is.True);
 
             // Assert.AreEqual(2, c.GetValue<int>("dict1","D","T"));
         }

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

@@ -116,7 +116,7 @@ namespace SharpGLTF.Schema2.Authoring
 
             var gltf2 = scene.ToGltf2();
             var clearCoatFactor = gltf2.LogicalMaterials[0].FindChannel("ClearCoat").Value.GetFactor("ClearCoatFactor");
-            Assert.AreEqual(0.5f, clearCoatFactor);
+            Assert.That(clearCoatFactor, Is.EqualTo(0.5f));
 
             scene.AttachToCurrentTest("result.glb");
             scene.AttachToCurrentTest("result.gltf");
@@ -152,7 +152,7 @@ namespace SharpGLTF.Schema2.Authoring
 
             var gltf2 = scene.ToGltf2();
             var transmissionFactor = gltf2.LogicalMaterials[0].FindChannel("Transmission").Value.GetFactor("TransmissionFactor");
-            Assert.AreEqual(0.75f, transmissionFactor);
+            Assert.That(transmissionFactor, Is.EqualTo(0.75f));
 
             scene.AttachToCurrentTest("result.glb");
             scene.AttachToCurrentTest("result.gltf");            
@@ -190,10 +190,10 @@ namespace SharpGLTF.Schema2.Authoring
 
             var gltf2 = scene.ToGltf2();
             var sheenColorFactor = gltf2.LogicalMaterials[0].FindChannel("SheenColor").Value.Color;
-            Assert.AreEqual(Vector4.One, sheenColorFactor);
+            Assert.That(sheenColorFactor, Is.EqualTo(Vector4.One));
 
             var sheenRoughnessFactor = gltf2.LogicalMaterials[0].FindChannel("SheenRoughness").Value.GetFactor("RoughnessFactor");
-            Assert.AreEqual(0.5f, sheenRoughnessFactor);
+            Assert.That(sheenRoughnessFactor, Is.EqualTo(0.5f));
 
             scene.AttachToCurrentTest("result.glb");
             scene.AttachToCurrentTest("result.gltf");

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

@@ -84,7 +84,7 @@ namespace SharpGLTF.Schema2.LoadAndSave
                 }*/
             }
 
-            Assert.IsTrue(passed);
+            Assert.That(passed);
         }        
     }
 }

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

@@ -20,7 +20,7 @@ namespace SharpGLTF.Schema2.LoadAndSave
 
             var validation = ModelRoot.Validate(path);
 
-            Assert.IsTrue(validation.HasErrors);
+            Assert.That(validation.HasErrors, Is.True);
         }
     }
 }

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

@@ -38,7 +38,7 @@ namespace SharpGLTF.Schema2.LoadAndSave
             try
             {
                 model = ModelRoot.Load(f, settings);
-                Assert.NotNull(model);
+                Assert.That(model, Is.Not.Null);
             }
             catch (Exception ex)
             {
@@ -62,7 +62,7 @@ namespace SharpGLTF.Schema2.LoadAndSave
                 if (unsupportedExtensions.All(uex => !model.ExtensionsUsed.Contains(uex)))
                 {
                     var detectedExtensions = model.GatherUsedExtensions().ToArray();
-                    CollectionAssert.AreEquivalent(model.ExtensionsUsed, detectedExtensions);
+                    Assert.That(detectedExtensions, Is.EquivalentTo(model.ExtensionsUsed));
                 }
             }
 
@@ -83,12 +83,12 @@ namespace SharpGLTF.Schema2.LoadAndSave
             var aa = a.GetLogicalChildrenFlattened().ToList();
             var bb = b.GetLogicalChildrenFlattened().ToList();
 
-            Assert.AreEqual(aa.Count, bb.Count);
+            Assert.That(bb, Has.Count.EqualTo(aa.Count));
 
-            CollectionAssert.AreEqual
+            Assert.That
                 (
                 aa.Select(item => item.GetType()),
-                bb.Select(item => item.GetType())
+                Is.EqualTo(bb.Select(item => item.GetType()))
                 );
         }
 
@@ -155,8 +155,8 @@ namespace SharpGLTF.Schema2.LoadAndSave
             var rtripDefBounds = Runtime.MeshDecoder.EvaluateBoundingBox(roundtripDefault.DefaultScene);
             var rtripGpuBounds = Runtime.MeshDecoder.EvaluateBoundingBox(roundtripInstanced.DefaultScene);
 
-            Assert.AreEqual(modelBounds, rtripDefBounds);
-            Assert.AreEqual(modelBounds, rtripGpuBounds);
+            Assert.That(rtripDefBounds, Is.EqualTo(modelBounds));
+            Assert.That(rtripGpuBounds, Is.EqualTo(modelBounds));
 
             // save results
 
@@ -193,15 +193,15 @@ namespace SharpGLTF.Schema2.LoadAndSave
                 .FirstOrDefault(item => item.EndsWith(@"UnlitTest\glTF-Binary\UnlitTest.glb"));
 
             var model = ModelRoot.Load(f);
-            Assert.NotNull(model);
+            Assert.That(model, Is.Not.Null);
 
-            Assert.IsTrue(model.LogicalMaterials[0].Unlit);
+            Assert.That(model.LogicalMaterials[0].Unlit, Is.True);
 
             // do a model roundtrip
             var modelBis = ModelRoot.ParseGLB(model.WriteGLB());
-            Assert.NotNull(modelBis);
+            Assert.That(modelBis, Is.Not.Null);
 
-            Assert.IsTrue(modelBis.LogicalMaterials[0].Unlit);
+            Assert.That(modelBis.LogicalMaterials[0].Unlit, Is.True);
         }
 
         [Test]
@@ -212,12 +212,12 @@ namespace SharpGLTF.Schema2.LoadAndSave
                 .FirstOrDefault(item => item.EndsWith("lights.gltf"));
 
             var model = ModelRoot.Load(f);
-            Assert.NotNull(model);
+            Assert.That(model, Is.Not.Null);
 
-            Assert.AreEqual(3, model.LogicalPunctualLights.Count);
+            Assert.That(model.LogicalPunctualLights, Has.Count.EqualTo(3));
 
-            Assert.AreEqual(1, model.DefaultScene.VisualChildren.ElementAt(0).PunctualLight.LogicalIndex);
-            Assert.AreEqual(0, model.DefaultScene.VisualChildren.ElementAt(1).PunctualLight.LogicalIndex);
+            Assert.That(model.DefaultScene.VisualChildren.ElementAt(0).PunctualLight.LogicalIndex, Is.EqualTo(1));
+            Assert.That(model.DefaultScene.VisualChildren.ElementAt(1).PunctualLight.LogicalIndex, Is.EqualTo(0));
         }
 
         [Test]
@@ -228,7 +228,7 @@ namespace SharpGLTF.Schema2.LoadAndSave
                 .FirstOrDefault(item => item.Contains("SimpleSparseAccessor.gltf"));
 
             var model = ModelRoot.Load(path);
-            Assert.NotNull(model);
+            Assert.That(model, Is.Not.Null);
 
             var primitive = model.LogicalMeshes[0].Primitives[0];
 
@@ -247,7 +247,7 @@ namespace SharpGLTF.Schema2.LoadAndSave
                 .FirstOrDefault(item => item.Contains("MorphPrimitivesTest.glb"));
 
             var model = ModelRoot.Load(path);
-            Assert.NotNull(model);
+            Assert.That(model, Is.Not.Null);
 
             var triangles = model.DefaultScene
                 .EvaluateTriangles<Geometry.VertexTypes.VertexPosition, Geometry.VertexTypes.VertexEmpty>(null, null, 0)
@@ -273,7 +273,7 @@ namespace SharpGLTF.Schema2.LoadAndSave
                 .FirstOrDefault(item => item.Contains(path));
 
             var model = ModelRoot.Load(path);
-            Assert.NotNull(model);
+            Assert.That(model, Is.Not.Null);
 
             path = System.IO.Path.GetFileNameWithoutExtension(path);
             model.AttachToCurrentTest(path + ".glb");
@@ -303,7 +303,7 @@ namespace SharpGLTF.Schema2.LoadAndSave
                 .FirstOrDefault(item => item.Contains("AnimatedMorphCube.glb"));
 
             var model = ModelRoot.Load(path);
-            Assert.NotNull(model);
+            Assert.That(model, Is.Not.Null);
 
             var anim = model.LogicalAnimations[0];
             var node = model.LogicalNodes[0];
@@ -374,7 +374,7 @@ namespace SharpGLTF.Schema2.LoadAndSave
                 .FirstOrDefault(item => item.Contains("TextureTransformMultiTest.glb"));
 
             var model = ModelRoot.Load(path);
-            Assert.NotNull(model);
+            Assert.That(model, Is.Not.Null);
 
             var materials = model.LogicalMaterials;
 
@@ -382,7 +382,7 @@ namespace SharpGLTF.Schema2.LoadAndSave
             var normalTest0Mat_normal = normalTest0Mat.FindChannel("Normal").Value;
             var normalTest0Mat_normal_xform = normalTest0Mat_normal.TextureTransform;            
 
-            Assert.NotNull(normalTest0Mat_normal_xform);
+            Assert.That(normalTest0Mat_normal_xform, Is.Not.Null);
         }
 
         [Test]

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

@@ -32,7 +32,7 @@ namespace SharpGLTF.Schema2.LoadAndSave
             var path = System.IO.Path.Combine(TestContext.CurrentContext.TestDirectory, "Assets\\white space.gltf");
 
             var model = ModelRoot.Load(path);
-            Assert.NotNull(model);
+            Assert.That(model, Is.Not.Null);
 
             model.AttachToCurrentTest("white space.glb");
         }
@@ -49,7 +49,7 @@ namespace SharpGLTF.Schema2.LoadAndSave
             // load Polly model
             var model = ModelRoot.Load(TestFiles.GetPollyFileModelPath(), Validation.ValidationMode.TryFix);
 
-            Assert.NotNull(model);
+            Assert.That(model, Is.Not.Null);
 
             var triangles = model.DefaultScene
                 .EvaluateTriangles<Geometry.VertexTypes.VertexPosition, Geometry.VertexTypes.VertexTexture1>(null, model.LogicalAnimations[0], 0.5f)
@@ -114,7 +114,7 @@ namespace SharpGLTF.Schema2.LoadAndSave
             var path = TestFiles.GetUniVRMModelPath();
             
             var model = ModelRoot.Load(path);
-            Assert.NotNull(model);
+            Assert.That(model, Is.Not.Null);
 
             var flattenExtensions = model.GatherUsedExtensions().ToArray();
 
@@ -127,7 +127,7 @@ namespace SharpGLTF.Schema2.LoadAndSave
             var path = "Assets\\SpecialCases\\shrekshao.glb";
 
             var model = ModelRoot.Load(path);
-            Assert.NotNull(model);
+            Assert.That(model, Is.Not.Null);
         }
 
         [Test]
@@ -151,7 +151,7 @@ namespace SharpGLTF.Schema2.LoadAndSave
             var node5_R_00 = sampler.GetPoint(0);
             var node5_R_01 = sampler.GetPoint(1);
 
-            Assert.AreEqual(node5_R_00, node5_R_01);
+            Assert.That(node5_R_01, Is.EqualTo(node5_R_00));
 
             model.AttachToCurrentTest("mouse_00.obj", model.LogicalAnimations[1], 0f);
             model.AttachToCurrentTest("mouse_01.obj", model.LogicalAnimations[1], 1f);
@@ -206,8 +206,8 @@ namespace SharpGLTF.Schema2.LoadAndSave
             // write to dictionary
             var wcontext = WriteContext.CreateFromDictionary(dictionary);
             model.Save("avocado.gltf", wcontext);
-            Assert.IsTrue(dictionary.ContainsKey("avocado.gltf"));
-            Assert.IsTrue(dictionary.ContainsKey("avocado.bin"));
+            Assert.That(dictionary.ContainsKey("avocado.gltf"), Is.True);
+            Assert.That(dictionary.ContainsKey("avocado.bin"), Is.True);
 
             // read back from dictionary
             var rcontext = ReadContext.CreateFromDictionary(dictionary);
@@ -232,7 +232,7 @@ namespace SharpGLTF.Schema2.LoadAndSave
             rsettings.JsonPreprocessor = _RemoveEmptyArrayJsonProcessor;
 
             var model = ModelRoot.Load(path, rsettings);
-            Assert.NotNull(model);
+            Assert.That(model, Is.Not.Null);
 
             // save the model, using a hook to modify the json before writing it to the file.
 
@@ -246,7 +246,7 @@ namespace SharpGLTF.Schema2.LoadAndSave
 
             model = ModelRoot.Load(path);
 
-            Assert.AreEqual(model.Asset.Generator, "postprocessed json");
+            Assert.That("postprocessed json", Is.EqualTo(model.Asset.Generator));
         }
 
 

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

@@ -26,8 +26,8 @@ namespace SharpGLTF.Schema2.LoadAndSave
             // absolute path            
 
             var model1 = ModelRoot.Load(modelPath, Validation.ValidationMode.TryFix);
-            Assert.NotNull(model1);
-            Assert.AreEqual(4, model1.LogicalImages.Count);
+            Assert.That(model1, Is.Not.Null);
+            Assert.That(model1.LogicalImages, Has.Count.EqualTo(4));
 
             TestContext.WriteLine(string.Join("   ", ModelRoot.GetSatellitePaths(modelPath)));
 
@@ -37,8 +37,8 @@ namespace SharpGLTF.Schema2.LoadAndSave
             var modelFile = System.IO.Path.GetFileName(modelPath);
 
             var model2 = ModelRoot.Load(modelFile, Validation.ValidationMode.TryFix);
-            Assert.NotNull(model2);
-            Assert.AreEqual(4, model2.LogicalImages.Count);
+            Assert.That(model2, Is.Not.Null);
+            Assert.That(model2.LogicalImages, Has.Count.EqualTo(4));
 
             TestContext.WriteLine(string.Join("   ", ModelRoot.GetSatellitePaths(modelPath)));
 
@@ -48,8 +48,8 @@ namespace SharpGLTF.Schema2.LoadAndSave
             Environment.CurrentDirectory = System.IO.Path.GetDirectoryName(Environment.CurrentDirectory);
 
             var model3 = ModelRoot.Load(modelFile, Validation.ValidationMode.TryFix);
-            Assert.NotNull(model3);
-            Assert.AreEqual(4, model3.LogicalImages.Count);
+            Assert.That(model3, Is.Not.Null);
+            Assert.That(model3.LogicalImages, Has.Count.EqualTo(4));
 
             TestContext.WriteLine(string.Join("   ", ModelRoot.GetSatellitePaths(modelPath)));
 
@@ -74,8 +74,8 @@ namespace SharpGLTF.Schema2.LoadAndSave
             var suzanne2 = ModelRoot.Load(path2);
             var suzanne2Mem = suzanne1.LogicalBuffers.Sum(item => item.Content.Length);
 
-            Assert.AreEqual(suzanne1Mem, suzanne2Mem);
-            Assert.AreEqual(suzanne1.LogicalMeshes.Count, suzanne2.LogicalMeshes.Count);
+            Assert.That(suzanne2Mem, Is.EqualTo(suzanne1Mem));
+            Assert.That(suzanne2.LogicalMeshes, Has.Count.EqualTo(suzanne1.LogicalMeshes.Count));
 
             // scenebuilder roundtrip
 
@@ -87,8 +87,8 @@ namespace SharpGLTF.Schema2.LoadAndSave
             var suzanne3 = ModelRoot.Load(path3);
             var suzanne3Mem = suzanne1.LogicalBuffers.Sum(item => item.Content.Length);
 
-            Assert.AreEqual(suzanne1Mem, suzanne3Mem);
-            Assert.AreEqual(suzanne1.LogicalMeshes.Count, suzanne3.LogicalMeshes.Count);
+            Assert.That(suzanne3Mem, Is.EqualTo(suzanne1Mem));
+            Assert.That(suzanne3.LogicalMeshes, Has.Count.EqualTo(suzanne1.LogicalMeshes.Count));
         }
 
         [Test]
@@ -100,7 +100,7 @@ namespace SharpGLTF.Schema2.LoadAndSave
             using(var ls = new ReadOnlyTestStream(bytes))
             {
                 var model = ModelRoot.ReadGLB(ls);
-                Assert.NotNull(model);
+                Assert.That(model, Is.Not.Null);
             }
         }
     }

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

@@ -22,11 +22,11 @@ namespace SharpGLTF.Schema2.LoadAndSave
             var path = System.IO.Path.Combine(TestContext.CurrentContext.TestDirectory, "Assets\\XmpJsonLd.gltf");
 
             var model = ModelRoot.Load(path);
-            Assert.NotNull(model);
+            Assert.That(model, Is.Not.Null);
 
             var packets = model.GetExtension<XmpPackets>();
-            Assert.NotNull(packets);
-            Assert.AreEqual(1, packets.JsonPackets.Count);
+            Assert.That(packets, Is.Not.Null);
+            Assert.That(packets.JsonPackets.Count, Is.EqualTo(1));
 
             var packet = packets.JsonPackets[0];
 

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

@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
-    <TargetFrameworks>net471;net6.0-windows;net8.0-windows</TargetFrameworks>
+    <TargetFrameworks>net471;net6.0;net8.0</TargetFrameworks>
     <IsPackable>false</IsPackable>
     <RootNamespace>SharpGLTF</RootNamespace>
     <LangVersion>latest</LangVersion>
@@ -16,17 +16,11 @@
   </ItemGroup>  
 
   <ItemGroup>
-    
-    <!--
-    <PackageReference Include="Mono.ApiTools.NuGetDiff" Version="1.3.1" />    
-    <PackageReference Include="Mono.ApiTools" Version="5.14.0.2" />
-    -->    
-    
     <PackageReference Include="NUnit3TestAdapter" Version="4.5.0">
       <PrivateAssets>all</PrivateAssets>
       <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
     </PackageReference>
     <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />    
-  </ItemGroup>    
+  </ItemGroup>
 
 </Project>

+ 13 - 13
tests/SharpGLTF.Core.Tests/Transforms/AffineTransformMatrixTests.cs

@@ -49,8 +49,8 @@ namespace SharpGLTF.Transforms
 
                 NumericsAssert.AreEqual(o, m, tolerance);
 
-                Assert.IsTrue(Matrix4x4.Decompose(m, out _, out _, out _));
-                Assert.IsTrue(Matrix4x4.Invert(m, out _));
+                Assert.That(Matrix4x4.Decompose(m, out _, out _, out _), Is.True);
+                Assert.That(Matrix4x4.Invert(m, out _), Is.True);
             }
 
             void testSkewed(Func<Matrix4x4, Matrix4x4> mf, float tolerance = 0)
@@ -59,14 +59,14 @@ namespace SharpGLTF.Transforms
 
                 var o = m = mf(m);
 
-                Assert.IsFalse(Matrix4x4.Decompose(m, out _, out _, out _));
+                Assert.That(Matrix4x4.Decompose(m, out _, out _, out _), Is.False);
 
                 Matrix4x4Factory.NormalizeMatrix(ref m);
 
                 NumericsAssert.AreEqual(o, m, tolerance);                
 
-                Assert.IsTrue(Matrix4x4.Decompose(m, out _, out _, out _));
-                Assert.IsTrue(Matrix4x4.Invert(m, out _));               
+                Assert.That(Matrix4x4.Decompose(m, out _, out _, out _), Is.True);
+                Assert.That(Matrix4x4.Invert(m, out _), Is.True);               
             }
             
             testSkewed(m => { m.M12 += 0.34f; return m; }, 0.34f);
@@ -86,10 +86,10 @@ namespace SharpGLTF.Transforms
             var SxR = Matrix4x4.CreateScale(5, 1, 1) * Matrix4x4.CreateFromYawPitchRoll(1, 2, 3);   // Decomposable
             var RxS = Matrix4x4.CreateFromYawPitchRoll(1, 2, 3) * Matrix4x4.CreateScale(5, 1, 1);   // Not Decomposable            
 
-            Assert.IsTrue(Matrix4x4.Decompose(SxR, out _, out _, out _));
+            Assert.That(Matrix4x4.Decompose(SxR, out _, out _, out _), Is.True);
             testMatrix(SxR, 0.0001f);
 
-            Assert.IsFalse(Matrix4x4.Decompose(RxS, out _, out _, out _));
+            Assert.That(Matrix4x4.Decompose(RxS, out _, out _, out _), Is.False);
             testMatrix(RxS, 100);           
         }
 
@@ -102,8 +102,8 @@ namespace SharpGLTF.Transforms
             NumericsAssert.AreEqual(Matrix4x4.Identity, asMatrix.Matrix);
             NumericsAssert.AreEqual(Matrix4x4.Identity, asDecomposed.Matrix);
 
-            Assert.IsTrue(asMatrix.IsIdentity);
-            Assert.IsTrue(asDecomposed.IsIdentity);
+            Assert.That(asMatrix.IsIdentity, Is.True);
+            Assert.That(asDecomposed.IsIdentity, Is.True);
         }
 
         [TestCase(false, false, false, false)]
@@ -161,11 +161,11 @@ namespace SharpGLTF.Transforms
         {
             var xf = new AffineTransform(new Vector3(sx, sy, sz), Quaternion.CreateFromYawPitchRoll(y, p, r), new Vector3(tx, ty, tz));
 
-            Assert.IsTrue(AffineTransform.TryInvert(xf, out var xi));            
-            Assert.IsTrue(Matrix4x4.Invert(xf.Matrix, out var mi));
+            Assert.That(AffineTransform.TryInvert(xf, out var xi), Is.True);            
+            Assert.That(Matrix4x4.Invert(xf.Matrix, out var mi), Is.True);
             mi.M44 = 1f;
 
-            if (isInvertibleToSRT) Assert.IsTrue(xi.IsSRT);
+            if (isInvertibleToSRT) Assert.That(xi.IsSRT, Is.True);
 
             var xmi = xi.Matrix;
 
@@ -178,7 +178,7 @@ namespace SharpGLTF.Transforms
             var diff = NumericsAssert.AreGeometryicallyEquivalent(mi, xmi, tolerance);
             TestContext.WriteLine(diff);
 
-            Assert.IsTrue(AffineTransform.AreGeometricallyEquivalent(mi, xi, tolerance));
+            Assert.That(AffineTransform.AreGeometricallyEquivalent(mi, xi, tolerance), Is.True);
         }
     }    
 }

+ 101 - 84
tests/SharpGLTF.Core.Tests/Transforms/SparseWeight8Tests.cs

@@ -31,40 +31,41 @@ namespace SharpGLTF.Transforms
 
             // creation mode 1
             var sparse = SparseWeight8.Create(array1);
-            Assert.AreEqual(array2.Sum(), sparse.WeightSum);
-            CollectionAssert.AreEqual(array2, sparse.Expand(array2.Length));            
+            Assert.That(sparse.WeightSum, Is.EqualTo(array2.Sum()));
+            Assert.That(sparse.Expand(array2.Length), Is.EqualTo(array2));            
 
             // creation mode 2
             var indexedSparse = SparseWeight8.Create(array3);
-            Assert.AreEqual(array2.Sum(), indexedSparse.WeightSum, 0.000001f);
-            CollectionAssert.AreEqual(array2, indexedSparse.Expand(array2.Length));
+            Assert.That(indexedSparse.WeightSum, Is.EqualTo(array2.Sum()).Within(0.000001f));
+            Assert.That(indexedSparse.Expand(array2.Length), Is.EqualTo(array2));
 
-            Assert.IsTrue(SparseWeight8.AreEqual(sparse, indexedSparse));
+            Assert.That(SparseWeight8.AreEqual(sparse, indexedSparse));
 
             // sort by weights
             var sByWeights = SparseWeight8.OrderedByWeight(sparse);
-            Assert.AreEqual(array2.Sum(), sByWeights.WeightSum);
-            CollectionAssert.AreEqual(array2, sByWeights.Expand(array2.Length));
+            Assert.That(sByWeights.WeightSum, Is.EqualTo(array2.Sum()));
+            Assert.That(sByWeights.Expand(array2.Length), Is.EqualTo(array2));
             CheckWeightOrdered(sByWeights);
 
             // sort by indices
             var sByIndices = SparseWeight8.OrderedByIndex(sByWeights);
-            Assert.AreEqual(array2.Sum(), sByIndices.WeightSum);
-            CollectionAssert.AreEqual(array2, sByIndices.Expand(array2.Length));
-            CheckIndexOrdered(sByWeights);
+            CheckIndexOrdered(sByIndices);
+            Assert.That(sByIndices.WeightSum, Is.EqualTo(array2.Sum()));
+            Assert.That(sByIndices.Expand(array2.Length), Is.EqualTo(array2));
+            
 
             // equality
-            Assert.IsTrue(SparseWeight8.AreEqual(sByIndices, sByWeights));
-            Assert.AreEqual(sByIndices.GetHashCode(), sByWeights.GetHashCode());
+            Assert.That(SparseWeight8.AreEqual(sByIndices, sByWeights), Is.True);
+            Assert.That(sByWeights.GetHashCode(), Is.EqualTo(sByIndices.GetHashCode()));
 
             // sum
             var sum = SparseWeight8.Add(sByIndices, sByWeights);
-            Assert.AreEqual(array2.Sum() * 2, sum.WeightSum);
+            Assert.That(sum.WeightSum, Is.EqualTo(array2.Sum() * 2));
 
             // complement normalization
             if (!array2.Any(item => item<0))
             {
-                Assert.GreaterOrEqual(sparse.GetNormalizedWithComplement(int.MaxValue).WeightSum, 1);
+                Assert.That(sparse.GetNormalizedWithComplement(int.MaxValue).WeightSum, Is.GreaterThanOrEqualTo(1));
             }
         }
 
@@ -82,43 +83,43 @@ namespace SharpGLTF.Transforms
                 (7, 1)
                 );
 
-            Assert.AreEqual(3, sparse[5]);
-            Assert.AreEqual(1, sparse[7]);
-            Assert.AreEqual(2, sparse[8]);
-            Assert.AreEqual(9, sparse[9]);
+            Assert.That(sparse[5], Is.EqualTo(3));
+            Assert.That(sparse[7], Is.EqualTo(1));
+            Assert.That(sparse[8], Is.EqualTo(2));
+            Assert.That(sparse[9], Is.EqualTo(9));
         }
 
         [Test]
         public void TestCreateSparseFromVectors()
         {
-            CollectionAssert.AreEqual
+            Assert.That
                 (
                 SparseWeight8.Create(new System.Numerics.Vector4(0, 1, 2, 3), new System.Numerics.Vector4(1, 1, 1, 1)).Expand(4),
-                SparseWeight8.Create(1, 1, 1, 1).Expand(4)
+                Is.EqualTo(SparseWeight8.Create(1, 1, 1, 1).Expand(4))
                 );
 
-            CollectionAssert.AreEqual
+            Assert.That
                 (
                 SparseWeight8.Create(new System.Numerics.Vector4(0, 1, 2, 3), new System.Numerics.Vector4(1, 2, 3, 4)).Expand(4),
-                SparseWeight8.Create(1, 2, 3, 4).Expand(4)
+                Is.EqualTo(SparseWeight8.Create(1, 2, 3, 4).Expand(4))
                 );
 
-            CollectionAssert.AreEqual
+            Assert.That
                 (
                 SparseWeight8.Create(new System.Numerics.Vector4(0, 1, 2, 3), new System.Numerics.Vector4(4, 3, 2, 1)).Expand(4),
-                SparseWeight8.Create(4, 3, 2, 1).Expand(4)
+                Is.EqualTo(SparseWeight8.Create(4, 3, 2, 1).Expand(4))
                 );
 
-            CollectionAssert.AreEqual
+            Assert.That
                 (
                 SparseWeight8.Create(new System.Numerics.Vector4(0, 2, 2, 3), new System.Numerics.Vector4(4, 3, 2, 1)).Expand(4),
-                SparseWeight8.Create(4, 0, 5, 1).Expand(4)
+                Is.EqualTo(SparseWeight8.Create(4, 0, 5, 1).Expand(4))
                 );
 
-            CollectionAssert.AreEqual
+            Assert.That
                 (
                 SparseWeight8.Create(new System.Numerics.Vector4(1, 1, 1, 1), new System.Numerics.Vector4(1, 1, 1, 1)).Expand(4),
-                SparseWeight8.Create(0, 4, 0, 0).Expand(4)
+                Is.EqualTo(SparseWeight8.Create(0, 4, 0, 0).Expand(4))
                 );
         }
 
@@ -162,24 +163,40 @@ namespace SharpGLTF.Transforms
 
         static void CheckWeightOrdered(SparseWeight8 sparse)
         {
-            Assert.GreaterOrEqual(Math.Abs(sparse.Weight0), Math.Abs(sparse.Weight1));
-            Assert.GreaterOrEqual(Math.Abs(sparse.Weight1), Math.Abs(sparse.Weight2));
-            Assert.GreaterOrEqual(Math.Abs(sparse.Weight2), Math.Abs(sparse.Weight3));
-            Assert.GreaterOrEqual(Math.Abs(sparse.Weight3), Math.Abs(sparse.Weight4));
-            Assert.GreaterOrEqual(Math.Abs(sparse.Weight4), Math.Abs(sparse.Weight5));
-            Assert.GreaterOrEqual(Math.Abs(sparse.Weight5), Math.Abs(sparse.Weight6));
-            Assert.GreaterOrEqual(Math.Abs(sparse.Weight6), Math.Abs(sparse.Weight7));
+            Assert.Multiple(() =>
+            {
+                Assert.That(Math.Abs(sparse.Weight0), Is.GreaterThanOrEqualTo(Math.Abs(sparse.Weight1)));
+                Assert.That(Math.Abs(sparse.Weight1), Is.GreaterThanOrEqualTo(Math.Abs(sparse.Weight2)));
+                Assert.That(Math.Abs(sparse.Weight2), Is.GreaterThanOrEqualTo(Math.Abs(sparse.Weight3)));
+                Assert.That(Math.Abs(sparse.Weight3), Is.GreaterThanOrEqualTo(Math.Abs(sparse.Weight4)));
+                Assert.That(Math.Abs(sparse.Weight4), Is.GreaterThanOrEqualTo(Math.Abs(sparse.Weight5)));
+                Assert.That(Math.Abs(sparse.Weight5), Is.GreaterThanOrEqualTo(Math.Abs(sparse.Weight6)));
+                Assert.That(Math.Abs(sparse.Weight6), Is.GreaterThanOrEqualTo(Math.Abs(sparse.Weight7)));
+            });
         }
 
         static void CheckIndexOrdered(SparseWeight8 sparse)
         {
-            Assert.LessOrEqual(sparse.Index0, sparse.Index0);
-            Assert.LessOrEqual(sparse.Index1, sparse.Index1);
-            Assert.LessOrEqual(sparse.Index2, sparse.Index2);
-            Assert.LessOrEqual(sparse.Index3, sparse.Index3);
-            Assert.LessOrEqual(sparse.Index4, sparse.Index4);
-            Assert.LessOrEqual(sparse.Index5, sparse.Index5);
-            Assert.LessOrEqual(sparse.Index6, sparse.Index6);
+            var pairs = sparse.GetIndexedWeights();
+
+            bool zeroFound = false;
+            long lastIndex = long.MinValue;
+
+            foreach(var (index,weight) in pairs)
+            {
+                if (weight == 0) zeroFound = true;
+
+                if (zeroFound)
+                {
+                    Assert.That(index, Is.EqualTo(0));
+                    Assert.That(weight, Is.EqualTo(0));
+                    continue;
+                }
+
+                Assert.That(index, Is.GreaterThan(lastIndex));
+
+                lastIndex = index;
+            }            
         }
 
         [Test]
@@ -189,20 +206,20 @@ namespace SharpGLTF.Transforms
                 .Create(0, 0, 0, 0, 0, 0.1f, 0.7f, 0, 0, 0, 0.1f)
                 .GetNormalizedWithComplement(int.MaxValue);
             
-            Assert.AreEqual(0.1f, sparse1[5]);
-            Assert.AreEqual(0.7f, sparse1[6]);
-            Assert.AreEqual(0.1f, sparse1[10]);
-            Assert.AreEqual(0.1f, sparse1[int.MaxValue], 0.0000001f);
-            Assert.AreEqual(1, sparse1.WeightSum);
+            Assert.That(sparse1[5], Is.EqualTo(0.1f));
+            Assert.That(sparse1[6], Is.EqualTo(0.7f));
+            Assert.That(sparse1[10], Is.EqualTo(0.1f));
+            Assert.That(sparse1[int.MaxValue], Is.EqualTo(0.1f).Within(0.0000001f));
+            Assert.That(sparse1.WeightSum, Is.EqualTo(1));
         }
 
         [Test]
         public void TestSparseEquality()
         {
-            Assert.IsTrue(SparseWeight8.AreEqual(SparseWeight8.Create(0, 1), SparseWeight8.Create(0, 1)));
+            Assert.That(SparseWeight8.AreEqual(SparseWeight8.Create(0, 1), SparseWeight8.Create(0, 1)), Is.True);
 
-            Assert.IsFalse(SparseWeight8.AreEqual(SparseWeight8.Create(0, 1), SparseWeight8.Create(0, 1, 0.25f)));
-            Assert.IsFalse(SparseWeight8.AreEqual(SparseWeight8.Create(0, 1), SparseWeight8.Create(1, 0)));
+            Assert.That(SparseWeight8.AreEqual(SparseWeight8.Create(0, 1), SparseWeight8.Create(0, 1, 0.25f)), Is.False);
+            Assert.That(SparseWeight8.AreEqual(SparseWeight8.Create(0, 1), SparseWeight8.Create(1, 0)), Is.False);
 
             // check if two "half weights" are equal to one "full weight"
             //Assert.IsTrue(SparseWeight8.AreWeightsEqual(SparseWeight8.Create((3, 5), (3, 5)), SparseWeight8.Create((3, 10))));
@@ -211,14 +228,14 @@ namespace SharpGLTF.Transforms
         [Test]
         public void TestSparseWeightsLinearInterpolation1()
         {
-            var x = SparseWeight8.Create(0,0,1,2); CollectionAssert.AreEqual(new[] { 0f, 0f, 1f, 2f }, x.Expand(4));
-            var y = SparseWeight8.Create(1,2,0,0); CollectionAssert.AreEqual(new[] { 1f, 2f, 0f, 0f }, y.Expand(4));
+            var x = SparseWeight8.Create(0,0,1,2); Assert.That(x.Expand(4), Is.EqualTo(new[] { 0f, 0f, 1f, 2f }));
+            var y = SparseWeight8.Create(1,2,0,0); Assert.That(y.Expand(4), Is.EqualTo(new[] { 1f, 2f, 0f, 0f }));
 
             var z = SparseWeight8.InterpolateLinear(x, y, 0.5f);
-            Assert.AreEqual(0.5f, z[0]);
-            Assert.AreEqual(1, z[1]);
-            Assert.AreEqual(0.5f, z[2]);
-            Assert.AreEqual(1, z[3]);
+            Assert.That(z[0], Is.EqualTo(0.5f));
+            Assert.That(z[1], Is.EqualTo(1));
+            Assert.That(z[2], Is.EqualTo(0.5f));
+            Assert.That(z[3], Is.EqualTo(1));
         }
 
         [Test]
@@ -228,15 +245,15 @@ namespace SharpGLTF.Transforms
             var ay = new float[] { 0, 0, 0.2f, 0, 0.1f,    0,    0, 0, 0, 0,    0, 0, 0.2f };
             var cc = Math.Min(ax.Length, ay.Length);
 
-            var x = SparseWeight8.Create(ax); CollectionAssert.AreEqual(ax, x.Expand(ax.Length));
-            var y = SparseWeight8.Create(ay); CollectionAssert.AreEqual(ay, y.Expand(ay.Length));
+            var x = SparseWeight8.Create(ax); Assert.That(x.Expand(ax.Length), Is.EqualTo(ax));
+            var y = SparseWeight8.Create(ay); Assert.That(y.Expand(ay.Length), Is.EqualTo(ay));
 
             var z = SparseWeight8.InterpolateLinear(x, y, 0.5f);
 
             for (int i=0; i < cc; ++i)
             {
                 var w = (ax[i] + ay[i]) / 2;
-                Assert.AreEqual(w, z[i]);
+                Assert.That(z[i], Is.EqualTo(w));
             }
         }
 
@@ -246,25 +263,25 @@ namespace SharpGLTF.Transforms
             var a = SparseWeight8.Create(0, 0, 0.2f, 0, 0, 0, 1);
             var b = SparseWeight8.Create(1, 1, 0.4f, 0, 0, 1, 0);
             var t = SparseWeight8.Subtract(b, a);
-            Assert.AreEqual(1, t[0]);
-            Assert.AreEqual(1, t[1]);
-            Assert.AreEqual(0.2f, t[2]);
-            Assert.AreEqual(0, t[3]);
-            Assert.AreEqual(0, t[4]);
-            Assert.AreEqual(1, t[5]);
-            Assert.AreEqual(-1, t[6]);
+            Assert.That(t[0], Is.EqualTo(1));
+            Assert.That(t[1], Is.EqualTo(1));
+            Assert.That(t[2], Is.EqualTo(0.2f));
+            Assert.That(t[3], Is.EqualTo(0));
+            Assert.That(t[4], Is.EqualTo(0));
+            Assert.That(t[5], Is.EqualTo(1));
+            Assert.That(t[6], Is.EqualTo(-1));
 
             var lr = SparseWeight8.InterpolateLinear(a, b, 0.4f);
             var cr = SparseWeight8.InterpolateCubic(a, t, b, t, 0.4f);
 
-            Assert.AreEqual(lr[0], cr[0], 0.000001f);
-            Assert.AreEqual(lr[1], cr[1], 0.000001f);
-            Assert.AreEqual(lr[2], cr[2], 0.000001f);
-            Assert.AreEqual(lr[3], cr[3], 0.000001f);
-            Assert.AreEqual(lr[4], cr[4], 0.000001f);
-            Assert.AreEqual(lr[5], cr[5], 0.000001f);
-            Assert.AreEqual(lr[6], cr[6], 0.000001f);
-            Assert.AreEqual(lr[7], cr[7], 0.000001f);
+            Assert.That(cr[0], Is.EqualTo(lr[0]).Within(0.000001f));
+            Assert.That(cr[1], Is.EqualTo(lr[1]).Within(0.000001f));
+            Assert.That(cr[2], Is.EqualTo(lr[2]).Within(0.000001f));
+            Assert.That(cr[3], Is.EqualTo(lr[3]).Within(0.000001f));
+            Assert.That(cr[4], Is.EqualTo(lr[4]).Within(0.000001f));
+            Assert.That(cr[5], Is.EqualTo(lr[5]).Within(0.000001f));
+            Assert.That(cr[6], Is.EqualTo(lr[6]).Within(0.000001f));
+            Assert.That(cr[7], Is.EqualTo(lr[7]).Within(0.000001f));
         }
 
         [Test]
@@ -274,17 +291,17 @@ namespace SharpGLTF.Transforms
 
             var b = a.GetTrimmed(4);
 
-            Assert.AreEqual(4, b.GetNonZeroWeights().Count());
+            Assert.That(b.GetNonZeroWeights().Count(), Is.EqualTo(4));
             
-            Assert.AreEqual(a[0], b[0]);
-            Assert.AreEqual(a[3], b[3]);
-            Assert.AreEqual(a[7], b[7]);
-            Assert.AreEqual(a[9], b[9]);
-
-            Assert.AreEqual(0, b.Weight4);
-            Assert.AreEqual(0, b.Weight5);
-            Assert.AreEqual(0, b.Weight6);
-            Assert.AreEqual(0, b.Weight7);            
+            Assert.That(b[0], Is.EqualTo(a[0]));
+            Assert.That(b[3], Is.EqualTo(a[3]));
+            Assert.That(b[7], Is.EqualTo(a[7]));
+            Assert.That(b[9], Is.EqualTo(a[9]));
+
+            Assert.That(b.Weight4, Is.EqualTo(0));
+            Assert.That(b.Weight5, Is.EqualTo(0));
+            Assert.That(b.Weight6, Is.EqualTo(0));
+            Assert.That(b.Weight7, Is.EqualTo(0));            
         }
     }
 }

+ 3 - 3
tests/SharpGLTF.Core.Tests/Validation/InvalidFilesTests.cs

@@ -28,7 +28,7 @@ namespace SharpGLTF.Validation
 
                 var result = Schema2.ModelRoot.Validate(f);
 
-                Assert.IsTrue(result.HasErrors == report.Issues.NumErrors > 0);
+                Assert.That(result.HasErrors, Is.EqualTo(report.Issues.NumErrors > 0));
             }
         }
 
@@ -49,7 +49,7 @@ namespace SharpGLTF.Validation
 
                 var result = Schema2.ModelRoot.Validate(f);
 
-                Assert.IsTrue(result.HasErrors == report.Issues.NumErrors > 0);
+                Assert.That(result.HasErrors, Is.EqualTo(report.Issues.NumErrors > 0));
             }
         }
 
@@ -85,7 +85,7 @@ namespace SharpGLTF.Validation
                     foreach (var e in report.Issues.Messages.Where(item => item.Severity == 0)) TestContext.WriteLine($"    {e.Text}");
                 }
 
-                Assert.AreEqual(report.Issues.NumErrors > 0, result.HasErrors, result.Errors.FirstOrDefault()?.Message);                                
+                Assert.That(result.HasErrors, Is.EqualTo(report.Issues.NumErrors > 0), result.Errors.FirstOrDefault()?.Message);                                
             }
         }
     }

+ 1 - 1
tests/SharpGLTF.DownloadTestFiles/ExampleFiles.cs

@@ -67,7 +67,7 @@ namespace SharpGLTF
         private readonly string _BabylonJsMeshesDir;
         private readonly string _BabylonJsPlaygroundDir;
 
-        private readonly string[] _BabylonJsInvalidFiles = { };
+        private readonly string[] _BabylonJsInvalidFiles = Array.Empty<string>();
 
         private string _GeneratedModelsDir;        
 

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

@@ -57,7 +57,7 @@ namespace SharpGLTF
         {
             string validationPath = null;
 
-            if (fileName.ToLowerInvariant().EndsWith(".glb"))
+            if (fileName.ToUpperInvariant().EndsWith(".GLB"))
             {
                 validationPath = fileName = AttachmentInfo
                     .From(fileName)
@@ -110,7 +110,7 @@ namespace SharpGLTF
                     TestContext.WriteLine(report.ToString());
                 }
 
-                Assert.AreNotEqual(GltfValidator.Severity.Error, report.Severity);
+                Assert.That(report.Severity, Is.Not.EqualTo(GltfValidator.Severity.Error));
             }
 
             return fileName;

+ 143 - 89
tests/SharpGLTF.NUnit/NumericsAssert.cs

@@ -21,14 +21,14 @@ namespace SharpGLTF
         {
             // Assert.IsTrue(float.IsFinite(value), message);
 
-            Assert.IsTrue(!float.IsNaN(value) && !float.IsInfinity(value), message);
+            Assert.That(!float.IsNaN(value) && !float.IsInfinity(value), Is.True, message);
         }
 
         public static void IsFinite(Double value, string message = null)
         {
             // Assert.IsTrue(double.IsFinite(value), message);
 
-            Assert.IsTrue(!Double.IsNaN(value) && !Double.IsInfinity(value), message);
+            Assert.That(!Double.IsNaN(value) && !Double.IsInfinity(value), Is.True, message);
         }
 
         public static void IsFinite(Vector2 vector)
@@ -105,20 +105,26 @@ namespace SharpGLTF
 
         public static void AreEqual(BigInteger expected, BigInteger actual, double tolerance = 0)
         {
-            Assert.AreEqual(0, (double)BigInteger.Abs(actual - expected), tolerance);
+            Assert.That((double)BigInteger.Abs(actual - expected), Is.EqualTo(0).Within(tolerance));
         }
         
         public static void AreEqual(Vector2 expected, Vector2 actual, double tolerance = 0)
         {
-            Assert.AreEqual(expected.X, actual.X, tolerance, "X");
-            Assert.AreEqual(expected.Y, actual.Y, tolerance, "Y");
+            Assert.Multiple(() =>
+            {
+                Assert.That(actual.X, Is.EqualTo(expected.X).Within(tolerance), "X");
+                Assert.That(actual.Y, Is.EqualTo(expected.Y).Within(tolerance), "Y");
+            });
         }
 
         public static float AreEqual(Vector3 expected, Vector3 actual, double tolerance = 0)
         {
-            Assert.AreEqual(expected.X, actual.X, tolerance, "X");
-            Assert.AreEqual(expected.Y, actual.Y, tolerance, "Y");
-            Assert.AreEqual(expected.Z, actual.Z, tolerance, "Z");
+            Assert.Multiple(() =>
+            {
+                Assert.That(actual.X, Is.EqualTo(expected.X).Within(tolerance), "X");
+                Assert.That(actual.Y, Is.EqualTo(expected.Y).Within(tolerance), "Y");
+                Assert.That(actual.Z, Is.EqualTo(expected.Z).Within(tolerance), "Z");
+            });
 
             // get tolerance
             var tx = Math.Abs(expected.X - actual.X);
@@ -129,41 +135,50 @@ namespace SharpGLTF
 
         public static void AreEqual(Vector4 expected, Vector4 actual, double tolerance = 0)
         {
-            Assert.AreEqual(expected.X, actual.X, tolerance, "X");
-            Assert.AreEqual(expected.Y, actual.Y, tolerance, "Y");
-            Assert.AreEqual(expected.Z, actual.Z, tolerance, "Z");
-            Assert.AreEqual(expected.W, actual.W, tolerance, "W");
+            Assert.Multiple(() =>
+            {
+                Assert.That(actual.X, Is.EqualTo(expected.X).Within(tolerance), "X");
+                Assert.That(actual.Y, Is.EqualTo(expected.Y).Within(tolerance), "Y");
+                Assert.That(actual.Z, Is.EqualTo(expected.Z).Within(tolerance), "Z");
+                Assert.That(actual.W, Is.EqualTo(expected.W).Within(tolerance), "W");
+            });
         }
 
         public static void AreEqual(Quaternion expected, Quaternion actual, double tolerance = 0)
         {
-            Assert.AreEqual(expected.X, actual.X, tolerance, "X");
-            Assert.AreEqual(expected.Y, actual.Y, tolerance, "Y");
-            Assert.AreEqual(expected.Z, actual.Z, tolerance, "Z");
-            Assert.AreEqual(expected.W, actual.W, tolerance, "W");
+            Assert.Multiple(() =>
+            {
+                Assert.That(actual.X, Is.EqualTo(expected.X).Within(tolerance), "X");
+                Assert.That(actual.Y, Is.EqualTo(expected.Y).Within(tolerance), "Y");
+                Assert.That(actual.Z, Is.EqualTo(expected.Z).Within(tolerance), "Z");
+                Assert.That(actual.W, Is.EqualTo(expected.W).Within(tolerance), "W");
+            });
         }
 
         public static void AreEqual(Matrix4x4 expected, Matrix4x4 actual, double tolerance = 0)
         {
-            Assert.AreEqual(expected.M11, actual.M11, tolerance, "M11");
-            Assert.AreEqual(expected.M12, actual.M12, tolerance, "M12");
-            Assert.AreEqual(expected.M13, actual.M13, tolerance, "M13");
-            Assert.AreEqual(expected.M14, actual.M14, tolerance, "M14");
+            Assert.Multiple(() =>
+            {
+                Assert.That(actual.M11, Is.EqualTo(expected.M11).Within(tolerance), "M11");
+                Assert.That(actual.M12, Is.EqualTo(expected.M12).Within(tolerance), "M12");
+                Assert.That(actual.M13, Is.EqualTo(expected.M13).Within(tolerance), "M13");
+                Assert.That(actual.M14, Is.EqualTo(expected.M14).Within(tolerance), "M14");
 
-            Assert.AreEqual(expected.M21, actual.M21, tolerance, "M21");
-            Assert.AreEqual(expected.M22, actual.M22, tolerance, "M22");
-            Assert.AreEqual(expected.M23, actual.M23, tolerance, "M23");
-            Assert.AreEqual(expected.M24, actual.M24, tolerance, "M24");
+                Assert.That(actual.M21, Is.EqualTo(expected.M21).Within(tolerance), "M21");
+                Assert.That(actual.M22, Is.EqualTo(expected.M22).Within(tolerance), "M22");
+                Assert.That(actual.M23, Is.EqualTo(expected.M23).Within(tolerance), "M23");
+                Assert.That(actual.M24, Is.EqualTo(expected.M24).Within(tolerance), "M24");
 
-            Assert.AreEqual(expected.M31, actual.M31, tolerance, "M31");
-            Assert.AreEqual(expected.M32, actual.M32, tolerance, "M32");
-            Assert.AreEqual(expected.M33, actual.M33, tolerance, "M33");
-            Assert.AreEqual(expected.M34, actual.M34, tolerance, "M34");
+                Assert.That(actual.M31, Is.EqualTo(expected.M31).Within(tolerance), "M31");
+                Assert.That(actual.M32, Is.EqualTo(expected.M32).Within(tolerance), "M32");
+                Assert.That(actual.M33, Is.EqualTo(expected.M33).Within(tolerance), "M33");
+                Assert.That(actual.M34, Is.EqualTo(expected.M34).Within(tolerance), "M34");
 
-            Assert.AreEqual(expected.M41, actual.M41, tolerance, "M41");
-            Assert.AreEqual(expected.M42, actual.M42, tolerance, "M42");
-            Assert.AreEqual(expected.M43, actual.M43, tolerance, "M43");
-            Assert.AreEqual(expected.M44, actual.M44, tolerance, "M44");
+                Assert.That(actual.M41, Is.EqualTo(expected.M41).Within(tolerance), "M41");
+                Assert.That(actual.M42, Is.EqualTo(expected.M42).Within(tolerance), "M42");
+                Assert.That(actual.M43, Is.EqualTo(expected.M43).Within(tolerance), "M43");
+                Assert.That(actual.M44, Is.EqualTo(expected.M44).Within(tolerance), "M44");
+            });
         }
 
         public static float AreGeometryicallyEquivalent(Matrix4x4 expected, Matrix4x4 actual, double tolerance = 0)
@@ -185,31 +200,37 @@ namespace SharpGLTF
         public static void IsInvertible(Matrix3x2 matrix)
         {
             IsFinite(matrix);
-            Assert.IsTrue(Matrix3x2.Invert(matrix, out Matrix3x2 inverted));
+            Assert.That(Matrix3x2.Invert(matrix, out Matrix3x2 inverted), Is.True);
         }
 
         public static void IsInvertible(Matrix4x4 matrix)
         {
             IsFinite(matrix);
-            Assert.IsTrue(Matrix4x4.Invert(matrix, out Matrix4x4 inverted));
+            Assert.That(Matrix4x4.Invert(matrix, out Matrix4x4 inverted), Is.True);
         }
 
         public static void IsOrthogonal3x3(Matrix4x4 matrix, double tolerance = 0)
         {
             IsFinite(matrix);
 
-            Assert.AreEqual(0, matrix.M41);
-            Assert.AreEqual(0, matrix.M42);
-            Assert.AreEqual(0, matrix.M43);
-            Assert.AreEqual(1, matrix.M44);
+            Assert.Multiple(() =>
+            {
+                Assert.That(matrix.M41, Is.EqualTo(0));
+                Assert.That(matrix.M42, Is.EqualTo(0));
+                Assert.That(matrix.M43, Is.EqualTo(0));
+                Assert.That(matrix.M44, Is.EqualTo(1));
+            });
 
             var cx = new Vector3(matrix.M11, matrix.M21, matrix.M31);
             var cy = new Vector3(matrix.M12, matrix.M22, matrix.M32);
-            var cz = new Vector3(matrix.M13, matrix.M23, matrix.M33);            
+            var cz = new Vector3(matrix.M13, matrix.M23, matrix.M33);
 
-            Assert.AreEqual(0, Vector3.Dot(cx, cy), tolerance);
-            Assert.AreEqual(0, Vector3.Dot(cx, cz), tolerance);
-            Assert.AreEqual(0, Vector3.Dot(cy, cz), tolerance);
+            Assert.Multiple(() =>
+            {
+                Assert.That(Vector3.Dot(cx, cy), Is.EqualTo(0).Within(tolerance));
+                Assert.That(Vector3.Dot(cx, cz), Is.EqualTo(0).Within(tolerance));
+                Assert.That(Vector3.Dot(cy, cz), Is.EqualTo(0).Within(tolerance));
+            });
         }
 
         public static void Length(Vector2 actual, double length, double tolerance = 0)
@@ -218,7 +239,7 @@ namespace SharpGLTF
 
             length = Math.Abs(actual.Length() - length);
 
-            Assert.AreEqual(0, length, tolerance);
+            Assert.That(length, Is.EqualTo(0).Within(tolerance));
         }
 
         public static void Length(Vector3 actual, double length, double tolerance = 0)
@@ -227,7 +248,7 @@ namespace SharpGLTF
 
             length = Math.Abs(actual.Length() - length);
 
-            Assert.AreEqual(0, length, tolerance);
+            Assert.That(length, Is.EqualTo(0).Within(tolerance));
         }
 
         public static void Length(Vector4 actual, double length, double tolerance = 0)
@@ -236,7 +257,7 @@ namespace SharpGLTF
 
             length = Math.Abs(actual.Length() - length);
 
-            Assert.AreEqual(0, length, tolerance);
+            Assert.That(length, Is.EqualTo(0).Within(tolerance));
         }
 
         public static void Length(Quaternion actual, double length, double tolerance = 0)
@@ -245,7 +266,7 @@ namespace SharpGLTF
 
             length = Math.Abs(actual.Length() - length);
 
-            Assert.AreEqual(0, length, tolerance);
+            Assert.That(length, Is.EqualTo(0).Within(tolerance));
         }
 
         public static void IsNormalized(Vector2 actual, double tolerance = 0)
@@ -294,127 +315,160 @@ namespace SharpGLTF
 
         public static void Less(BigInteger arg1, BigInteger arg2)
         {
-            Assert.Less(arg1.CompareTo(arg2), 0);
+            Assert.That(arg1.CompareTo(arg2), Is.LessThan(0));
         }
 
         public static void Less(Vector2 arg1, Vector2 arg2)
         {
-            Assert.Less(arg1.X, arg2.X, "X");
-            Assert.Less(arg1.Y, arg2.Y, "Y");
+            Assert.Multiple(() =>
+            {
+                Assert.That(arg1.X, Is.LessThan(arg2.X), "X");
+                Assert.That(arg1.Y, Is.LessThan(arg2.Y), "Y");
+            });
         }
 
         public static void Less(Vector3 arg1, Vector3 arg2)
         {
-            Assert.Less(arg1.X, arg2.X, "X");
-            Assert.Less(arg1.Y, arg2.Y, "Y");
-            Assert.Less(arg1.Z, arg2.Z, "Z");
+            Assert.Multiple(() =>
+            {
+                Assert.That(arg1.X, Is.LessThan(arg2.X), "X");
+                Assert.That(arg1.Y, Is.LessThan(arg2.Y), "Y");
+                Assert.That(arg1.Z, Is.LessThan(arg2.Z), "Z");
+            });
         }
 
         public static void Less(Vector4 arg1, Vector4 arg2)
         {
-            Assert.Less(arg1.X, arg2.X, "X");
-            Assert.Less(arg1.Y, arg2.Y, "Y");
-            Assert.Less(arg1.Z, arg2.Z, "Z");
-            Assert.Less(arg1.W, arg2.W, "W");
+            Assert.Multiple(() =>
+            {
+                Assert.That(arg1.X, Is.LessThan(arg2.X), "X");
+                Assert.That(arg1.Y, Is.LessThan(arg2.Y), "Y");
+                Assert.That(arg1.Z, Is.LessThan(arg2.Z), "Z");
+                Assert.That(arg1.W, Is.LessThan(arg2.W), "W");
+            });
         }
 
         public static void LessOrEqual(BigInteger arg1, BigInteger arg2)
         {
-            Assert.LessOrEqual(arg1.CompareTo(arg2), 0);
+            Assert.That(arg1.CompareTo(arg2), Is.LessThanOrEqualTo(0));
         }
 
         public static void LessOrEqual(Vector2 arg1, Vector2 arg2)
         {
-            Assert.LessOrEqual(arg1.X, arg2.X, "X");
-            Assert.LessOrEqual(arg1.Y, arg2.Y, "Y");
+            Assert.Multiple(() =>
+            {
+                Assert.That(arg1.X, Is.LessThanOrEqualTo(arg2.X), "X");
+                Assert.That(arg1.Y, Is.LessThanOrEqualTo(arg2.Y), "Y");
+            });
         }
 
         public static void LessOrEqual(Vector3 arg1, Vector3 arg2)
         {
-            Assert.LessOrEqual(arg1.X, arg2.X, "X");
-            Assert.LessOrEqual(arg1.Y, arg2.Y, "Y");
-            Assert.LessOrEqual(arg1.Z, arg2.Z, "Z");            
+            Assert.Multiple(() =>
+            {
+                Assert.That(arg1.X, Is.LessThanOrEqualTo(arg2.X), "X");
+                Assert.That(arg1.Y, Is.LessThanOrEqualTo(arg2.Y), "Y");
+                Assert.That(arg1.Z, Is.LessThanOrEqualTo(arg2.Z), "Z");
+            });
         }
 
         public static void LessOrEqual(Vector4 arg1, Vector4 arg2)
         {
-            Assert.LessOrEqual(arg1.X, arg2.X, "X");
-            Assert.LessOrEqual(arg1.Y, arg2.Y, "Y");
-            Assert.LessOrEqual(arg1.Z, arg2.Z, "Z");
-            Assert.LessOrEqual(arg1.W, arg2.W, "W");
+            Assert.Multiple(() =>
+            {
+                Assert.That(arg1.X, Is.LessThanOrEqualTo(arg2.X), "X");
+                Assert.That(arg1.Y, Is.LessThanOrEqualTo(arg2.Y), "Y");
+                Assert.That(arg1.Z, Is.LessThanOrEqualTo(arg2.Z), "Z");
+                Assert.That(arg1.W, Is.LessThanOrEqualTo(arg2.W), "W");
+            });
         }
 
         public static void Greater(BigInteger arg1, BigInteger arg2)
         {
-            Assert.Greater(arg1.CompareTo(arg2), 0);
+            Assert.That(arg1.CompareTo(arg2), Is.GreaterThan(0));
         }
 
         public static void Greater(Vector2 arg1, Vector2 arg2)
         {
-            Assert.Greater(arg1.X, arg2.X, "X");
-            Assert.Greater(arg1.Y, arg2.Y, "Y");
+            Assert.That(arg1.X, Is.GreaterThan(arg2.X), "X");
+            Assert.That(arg1.Y, Is.GreaterThan(arg2.Y), "Y");
         }
 
         public static void Greater(Vector3 arg1, Vector3 arg2)
         {
-            Assert.Greater(arg1.X, arg2.X, "X");
-            Assert.Greater(arg1.Y, arg2.Y, "Y");
-            Assert.Greater(arg1.Z, arg2.Z, "Z");
+            Assert.Multiple(() =>
+            {
+                Assert.That(arg1.X, Is.GreaterThan(arg2.X), "X");
+                Assert.That(arg1.Y, Is.GreaterThan(arg2.Y), "Y");
+                Assert.That(arg1.Z, Is.GreaterThan(arg2.Z), "Z");
+            });
         }
 
         public static void Greater(Vector4 arg1, Vector4 arg2)
         {
-            Assert.Greater(arg1.X, arg2.X, "X");
-            Assert.Greater(arg1.Y, arg2.Y, "Y");
-            Assert.Greater(arg1.Z, arg2.Z, "Z");
-            Assert.Greater(arg1.W, arg2.W, "W");
+            Assert.Multiple(() =>
+            {
+                Assert.That(arg1.X, Is.GreaterThan(arg2.X), "X");
+                Assert.That(arg1.Y, Is.GreaterThan(arg2.Y), "Y");
+                Assert.That(arg1.Z, Is.GreaterThan(arg2.Z), "Z");
+                Assert.That(arg1.W, Is.GreaterThan(arg2.W), "W");
+            });
         }
 
         public static void GreaterOrEqual(BigInteger arg1, BigInteger arg2)
         {
-            Assert.GreaterOrEqual(arg1.CompareTo(arg2), 0);
+            Assert.That(arg1.CompareTo(arg2), Is.GreaterThanOrEqualTo(0));
         }
 
         public static void GreaterOrEqual(Vector2 arg1, Vector2 arg2)
         {
-            Assert.GreaterOrEqual(arg1.X, arg2.X, "X");
-            Assert.GreaterOrEqual(arg1.Y, arg2.Y, "Y");
+            Assert.Multiple(() =>
+            {
+                Assert.That(arg1.X, Is.GreaterThanOrEqualTo(arg2.X), "X");
+                Assert.That(arg1.Y, Is.GreaterThanOrEqualTo(arg2.Y), "Y");
+            });
         }
 
         public static void GreaterOrEqual(Vector3 arg1, Vector3 arg2)
         {
-            Assert.GreaterOrEqual(arg1.X, arg2.X, "X");
-            Assert.GreaterOrEqual(arg1.Y, arg2.Y, "Y");
-            Assert.GreaterOrEqual(arg1.Z, arg2.Z, "Z");
+            Assert.Multiple(() =>
+            {
+                Assert.That(arg1.X, Is.GreaterThanOrEqualTo(arg2.X), "X");
+                Assert.That(arg1.Y, Is.GreaterThanOrEqualTo(arg2.Y), "Y");
+                Assert.That(arg1.Z, Is.GreaterThanOrEqualTo(arg2.Z), "Z");
+            });
         }
 
         public static void GreaterOrEqual(Vector4 arg1, Vector4 arg2)
         {
-            Assert.GreaterOrEqual(arg1.X, arg2.X, "X");
-            Assert.GreaterOrEqual(arg1.Y, arg2.Y, "Y");
-            Assert.GreaterOrEqual(arg1.Z, arg2.Z, "Z");
-            Assert.GreaterOrEqual(arg1.W, arg2.W, "W");
+            Assert.Multiple(() =>
+            {
+                Assert.That(arg1.X, Is.GreaterThanOrEqualTo(arg2.X), "X");
+                Assert.That(arg1.Y, Is.GreaterThanOrEqualTo(arg2.Y), "Y");
+                Assert.That(arg1.Z, Is.GreaterThanOrEqualTo(arg2.Z), "Z");
+                Assert.That(arg1.W, Is.GreaterThanOrEqualTo(arg2.W), "W");
+            });
         }
 
         public static void AngleLessOrEqual(Vector2 a, Vector2 b, double radians)
         {
             var angle = (a, b).GetAngle();
 
-            Assert.LessOrEqual(angle, radians, "Angle");
+            Assert.That(angle, Is.LessThanOrEqualTo(radians), "Angle");
         }
 
         public static void AngleLessOrEqual(Vector3 a, Vector3 b, double radians)
         {
             var angle = (a, b).GetAngle();
 
-            Assert.LessOrEqual(angle, radians, "Angle");
+            Assert.That(angle, Is.LessThanOrEqualTo(radians), "Angle");
         }
 
         public static void AngleLessOrEqual(Quaternion a, Quaternion b, double radians)
         {
             var angle = (a, b).GetAngle();
 
-            Assert.LessOrEqual(angle, radians, "Angle");
+            Assert.That(angle, Is.LessThanOrEqualTo(radians), "Angle");
         }
     }
 }

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

@@ -8,10 +8,10 @@
   </PropertyGroup>
 
   <ItemGroup>
-    <PackageReference Include="nunit" Version="3.14.0" />
+    <PackageReference Include="nunit" Version="4.0.0" />
     <PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
     <PackageReference Include="GltfValidator" Version="2.0.0-dev.3.8.202311262112" />    
-    <PackageReference Include="TestAttachments.NUnit" Version="3.0.0-Preview-20220721-1621" />    
+    <PackageReference Include="TestAttachments.NUnit" Version="4.0.0-Preview-20231128-1207" />    
   </ItemGroup>
 
   <ItemGroup>    

+ 3 - 3
tests/SharpGLTF.NUnit/TestFiles.cs

@@ -35,7 +35,7 @@ namespace SharpGLTF
                 wdir = System.IO.Path.GetDirectoryName(wdir);
             }
 
-            Assert.IsTrue(examplesFound, "TestFiles directory not found; please, run '1_DownloadTestFiles.cmd' before running the tests.");            
+            Assert.That(examplesFound, "TestFiles directory not found; please, run '1_DownloadTestFiles.cmd' before running the tests.");            
 
             _AssetFilesDir = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(_TestFilesDir), "Assets");
         }
@@ -201,8 +201,8 @@ namespace SharpGLTF
             var files = GetModelPathsInDirectory(_BabylonJsMeshesDir);
 
             return files
-                .Where(item => !item.ToLowerInvariant().Contains("gltf-draco"))
-                .Where(item => !item.ToLowerInvariant().Contains("gltf-meshopt")) // not supported yet
+                .Where(item => !item.ToUpperInvariant().Contains("GLTF-DRACO"))
+                .Where(item => !item.ToUpperInvariant().Contains("GLTF-MESHOPT")) // not supported yet
                 .Where(item => skipAlways.All(f => !item.Contains(f)))                
                 .OrderBy(item => item)                
                 .ToList();

+ 3 - 3
tests/SharpGLTF.Runtime.Tests/Runtime/SceneTemplateTests.cs

@@ -39,8 +39,8 @@ namespace SharpGLTF.Runtime
             GC.Collect();
             GC.WaitForFullGCComplete();
 
-            Assert.IsFalse(result.Item2.TryGetTarget(out Schema2.ModelRoot model));
-            Assert.Null(model);
+            Assert.That(result.Item2.TryGetTarget(out Schema2.ModelRoot model), Is.False);
+            Assert.That(model, Is.Null);
         }
 
         private static (SceneTemplate, WeakReference<Schema2.ModelRoot>) LoadModelTemplate(string path)
@@ -120,7 +120,7 @@ namespace SharpGLTF.Runtime
             foreach(var p in vertices)
             {
                 var d = (p - center).Length();
-                Assert.LessOrEqual(d, radius + 0.0001f);
+                Assert.That(d, Is.LessThanOrEqualTo(radius + 0.0001f));
             }
         }
 

+ 2 - 7
tests/SharpGLTF.Runtime.Tests/SharpGLTF.Runtime.Tests.csproj

@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
-    <TargetFrameworks>net471;net6.0-windows;net8.0-windows</TargetFrameworks>
+    <TargetFrameworks>net471;net6.0;net8.0</TargetFrameworks>
     <IsPackable>false</IsPackable>
     <RootNamespace>SharpGLTF</RootNamespace>
     <LangVersion>latest</LangVersion>
@@ -15,12 +15,7 @@
     <ProjectReference Include="..\SharpGLTF.NUnit\SharpGLTF.NUnit.csproj" />
   </ItemGroup>
 
-  <ItemGroup>
-
-    <!--
-    <PackageReference Include="Mono.ApiTools.NuGetDiff" Version="1.3.1" />    
-    <PackageReference Include="Mono.ApiTools" Version="5.14.0.2" />
-    -->
+  <ItemGroup>    
 
     <PackageReference Include="NUnit3TestAdapter" Version="4.5.0">
       <PrivateAssets>all</PrivateAssets>

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

@@ -60,7 +60,7 @@ namespace SharpGLTF.ThirdParty
                     greenColor));
             }
 
-            Assert.AreEqual(3, morphTargetBuilder.Vertices.Count);
+            Assert.That(morphTargetBuilder.Vertices, Has.Count.EqualTo(3));
 
             // save the model in different formats
             var model = scene.ToGltf2();
@@ -79,13 +79,13 @@ namespace SharpGLTF.ThirdParty
 
             var triangles = Schema2.Toolkit
                 .EvaluateTriangles(model.DefaultScene, null, model.LogicalAnimations[0], 0.5f)
-                .ToArray();
+                .ToList();
 
             var morphedColor = triangles[0].A.GetMaterial().GetColor(0);
-            Assert.AreEqual(0.5f, morphedColor.X);
-            Assert.AreEqual(0.5f, morphedColor.Y);
-            Assert.AreEqual(0, morphedColor.Z);
-            Assert.AreEqual(1, morphedColor.W);
+            Assert.That(morphedColor.X, Is.EqualTo(0.5f));
+            Assert.That(morphedColor.Y, Is.EqualTo(0.5f));
+            Assert.That(morphedColor.Z, Is.EqualTo(0));
+            Assert.That(morphedColor.W, Is.EqualTo(1));
 
             // save the model in different formats
             // model.AttachToCurrentTest("ColorAndTextureMorphing.glb");
@@ -140,7 +140,7 @@ namespace SharpGLTF.ThirdParty
                     Vector2.One));
             }
 
-            Assert.AreEqual(3, morphTargetBuilder.Vertices.Count);
+            Assert.That(morphTargetBuilder.Vertices, Has.Count.EqualTo(3));
 
             // save the model in different formats
             var model = scene.ToGltf2();
@@ -162,8 +162,8 @@ namespace SharpGLTF.ThirdParty
                 .ToArray();
 
             var morphedTextCoord = triangles[0].A.GetMaterial().GetTexCoord(0);
-            Assert.AreEqual(0.5f, morphedTextCoord.X);
-            Assert.AreEqual(0.5f, morphedTextCoord.Y);
+            Assert.That(morphedTextCoord.X, Is.EqualTo(0.5f));
+            Assert.That(morphedTextCoord.Y, Is.EqualTo(0.5f));
 
             // save the model in different formats
             // model.AttachToCurrentTest("ColorAndTextureMorphing.glb");
@@ -221,7 +221,7 @@ namespace SharpGLTF.ThirdParty
                     new VertexColor1Texture1(morphToTransparentGrey, Vector2.One)));
             }
 
-            Assert.AreEqual(3, morphTargetBuilder.Vertices.Count);
+            Assert.That(morphTargetBuilder.Vertices, Has.Count.EqualTo(3));
 
             // save the model in different formats
             var model = scene.ToGltf2();
@@ -243,8 +243,8 @@ namespace SharpGLTF.ThirdParty
                 .ToArray();
 
             var morphedTextCoord = triangles[0].A.GetMaterial().GetTexCoord(0);
-            Assert.AreEqual(0.5f, morphedTextCoord.X);
-            Assert.AreEqual(0.5f, morphedTextCoord.Y);
+            Assert.That(morphedTextCoord.X, Is.EqualTo(0.5f));
+            Assert.That(morphedTextCoord.Y, Is.EqualTo(0.5f));
 
             // save the model in different formats
             // model.AttachToCurrentTest("ColorAndTextureMorphing.glb");

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

@@ -33,19 +33,19 @@ namespace SharpGLTF.ThirdParty
             settings.GpuMeshInstancingMinCount = 0;
             var instancedModel = sceneBuilder.ToGltf2(settings);
 
-            Assert.AreEqual(1,instancedModel.LogicalNodes.Count);
+            Assert.That(instancedModel.LogicalNodes.Count, Is.EqualTo(1));
 
             var node = instancedModel.LogicalNodes[0];
             var instances = node.GetExtension<MeshGpuInstancing>();
-            Assert.NotNull(instances);
+            Assert.That(instances, Is.Not.Null);
 
-            Assert.AreEqual(2, instances.Accessors.Count);
-            CollectionAssert.Contains(instances.Accessors.Keys, "TRANSLATION");
-            CollectionAssert.Contains(instances.Accessors.Keys, "_FEATURE_ID_0");
+            Assert.That(instances.Accessors, Has.Count.EqualTo(2));
+            Assert.That(instances.Accessors.Keys, Does.Contain("TRANSLATION"));
+            Assert.That(instances.Accessors.Keys, Does.Contain("_FEATURE_ID_0"));
 
             var ids = instances.Accessors["_FEATURE_ID_0"].AsIndicesArray();
 
-            CollectionAssert.AreEqual(new int[] { 0, 1 }, ids);
+            Assert.That(ids, Is.EqualTo(new int[] { 0, 1 }));
 
             var dstPath = AttachmentInfo
                 .From("instanced_model_with_feature_id.glb")

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

@@ -42,7 +42,7 @@ namespace SharpGLTF.ThirdParty
             prim.AddTriangle(v0, v1, v3);
             prim.AddTriangle(v3, v1, v2);
 
-            Assert.AreEqual(8, prim.Vertices.Count);
+            Assert.That(prim.Vertices, Has.Count.EqualTo(8));
 
             // create a scene
 

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

@@ -79,7 +79,7 @@ namespace SharpGLTF.ThirdParty
 
             var satellites = ModelRoot.GetSatellitePaths(resultPath0.FullName);
 
-            Assert.AreEqual(4, satellites.Length);
+            Assert.That(satellites, Has.Length.EqualTo(4));
         }
 
         [Test]
@@ -156,7 +156,7 @@ namespace SharpGLTF.ThirdParty
 
             var gltf = scene.ToGltf2();
 
-            Assert.AreEqual(1, gltf.LogicalMeshes.Count);
+            Assert.That(gltf.LogicalMeshes, Has.Count.EqualTo(1));
 
             var outFiles = new[]
             {

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

@@ -93,10 +93,10 @@ namespace SharpGLTF.ThirdParty
 
             // Assert
             var morphedColor = triangles[1].A.GetMaterial().GetColor(0);
-            Assert.AreEqual(expMorphColor, morphedColor);
+            Assert.That(morphedColor, Is.EqualTo(expMorphColor));
             
             morphedColor = triangles[0].A.GetMaterial().GetColor(0);
-            Assert.AreEqual(redColor, morphedColor);
+            Assert.That(morphedColor, Is.EqualTo(redColor));
 
             // save the model in different formats
             AttachmentInfo

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

@@ -127,13 +127,13 @@ namespace SharpGLTF.ThirdParty
 
             // Assert
             var morphedColor = triangles[1].A.GetMaterial().GetColor(0);
-            Assert.AreEqual(0.5f, morphedColor.X);
-            Assert.AreEqual(0.5f, morphedColor.Y);
-            Assert.AreEqual(0, morphedColor.Z);
-            Assert.AreEqual(1, morphedColor.W);
+            Assert.That(morphedColor.X, Is.EqualTo(0.5f));
+            Assert.That(morphedColor.Y, Is.EqualTo(0.5f));
+            Assert.That(morphedColor.Z, Is.EqualTo(0));
+            Assert.That(morphedColor.W, Is.EqualTo(1));
 
             morphedColor = triangles[0].A.GetMaterial().GetColor(0);
-            Assert.AreEqual(redColor, morphedColor);
+            Assert.That(morphedColor, Is.EqualTo(redColor));
 
 
             
@@ -181,7 +181,7 @@ namespace SharpGLTF.ThirdParty
             // https://github.com/vpenades/SharpGLTF/issues/158
 
             var gltf = ModelRoot.Load(ResourceInfo.From("Gotoarchi\\test1.gltf"));
-            Assert.NotNull(gltf);
+            Assert.That(gltf, Is.Not.Null);
         }
     }
 }

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

@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
-    <TargetFrameworks>net471;net8.0-windows</TargetFrameworks>
+    <TargetFrameworks>net471;net8.0</TargetFrameworks>
     <IsPackable>false</IsPackable>
     <RootNamespace>SharpGLTF.ThirdParty</RootNamespace>
     <LangVersion>latest</LangVersion>
@@ -16,7 +16,7 @@
   </ItemGroup>
 
   <ItemGroup>
-    <PackageReference Include="NUnit" Version="3.14.0" />
+    <PackageReference Include="NUnit" Version="4.0.0" />
     <PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
     <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
     <PackageReference Include="System.Drawing.Common" Version="8.0.0" />    

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

@@ -38,11 +38,11 @@ namespace SharpGLTF.ThirdParty
 
             var model = sceneBuilder.ToGltf2();
 
-            Assert.AreEqual("alternateTextureName.*", model.LogicalImages[0].AlternateWriteFileName);
+            Assert.That(model.LogicalImages[0].AlternateWriteFileName, Is.EqualTo("alternateTextureName.*"));
 
             model = model.DeepClone();
 
-            Assert.AreEqual("alternateTextureName.*", model.LogicalImages[0].AlternateWriteFileName);
+            Assert.That(model.LogicalImages[0].AlternateWriteFileName, Is.EqualTo("alternateTextureName.*"));
 
             var dstPath = AttachmentInfo
                 .From("model.gltf")
@@ -50,7 +50,7 @@ namespace SharpGLTF.ThirdParty
 
             var altPath = System.IO.Path.Combine(dstPath.Directory.FullName, "alternateTextureName.png");
 
-            Assert.IsTrue(System.IO.File.Exists(altPath));
+            Assert.That(System.IO.File.Exists(altPath));
         }
     }
 }

+ 10 - 10
tests/SharpGLTF.Toolkit.Tests/Animations/CurveBuilderTests.cs

@@ -32,7 +32,7 @@ namespace SharpGLTF.Animations
             // convert and resample the curve to a linear and cubic curves.
 
             var convertible = curve as IConvertibleCurve<Vector3>;
-            Assert.NotNull(convertible);
+            Assert.That(convertible, Is.Not.Null);
 
             var linear = convertible.ToLinearCurve().Select(kvp => (kvp.Key, kvp.Value)).CreateSampler();
             var spline = convertible.ToSplineCurve().Select(kvp => (kvp.Key, kvp.Value)).CreateSampler();
@@ -81,7 +81,7 @@ namespace SharpGLTF.Animations
             // convert and resample the curve to a linear and cubic curves.
 
             var convertible = curve as IConvertibleCurve<Quaternion>;
-            Assert.NotNull(convertible);
+            Assert.That(convertible, Is.Not.Null);
 
             var linear = convertible.ToLinearCurve().Select(kvp => (kvp.Key, kvp.Value)).CreateSampler();
             var spline = convertible.ToSplineCurve().Select(kvp => (kvp.Key, kvp.Value)).CreateSampler();
@@ -130,7 +130,7 @@ namespace SharpGLTF.Animations
             // convert and resample the curve to a linear and cubic curves.
 
             var convertible = curve as IConvertibleCurve<Transforms.SparseWeight8>;
-            Assert.NotNull(convertible);
+            Assert.That(convertible, Is.Not.Null);
 
             var linear = convertible.ToLinearCurve().Select(kvp => (kvp.Key, kvp.Value)).CreateSampler();
             var spline = convertible.ToSplineCurve().Select(kvp => (kvp.Key, kvp.Value)).CreateSampler();
@@ -143,14 +143,14 @@ namespace SharpGLTF.Animations
                 var ls = linear.GetPoint(t);
                 var ss = spline.GetPoint(t);
 
-                Assert.AreEqual(cc[0], ls[0], 0.02f);
-                Assert.AreEqual(cc[1], ls[1], 0.02f);
+                Assert.That(ls[0], Is.EqualTo(cc[0]).Within(0.02f));
+                Assert.That(ls[1], Is.EqualTo(cc[1]).Within(0.02f));
 
-                Assert.AreEqual(cc[0], ss[0], 0.02f);
-                Assert.AreEqual(cc[1], ss[1], 0.02f);
+                Assert.That(ss[0], Is.EqualTo(cc[0]).Within(0.02f));
+                Assert.That(ss[1], Is.EqualTo(cc[1]).Within(0.02f));
 
-                Assert.AreEqual(ls[0], ss[0], 0.02f);
-                Assert.AreEqual(ls[1], ss[1], 0.02f);
+                Assert.That(ss[0], Is.EqualTo(ls[0]).Within(0.02f));
+                Assert.That(ss[1], Is.EqualTo(ls[1]).Within(0.02f));
             }
 
             // plot the curve.
@@ -190,7 +190,7 @@ namespace SharpGLTF.Animations
             instanceNode.SetAnimationFrame(0, 7);
             var nodeMatrix = instanceNode.LocalMatrix;
 
-            Assert.AreEqual(new Vector3(1, 2, 3), nodeMatrix.Translation);
+            Assert.That(nodeMatrix.Translation, Is.EqualTo(new Vector3(1, 2, 3)));
         }
 
     }

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

@@ -106,11 +106,11 @@ namespace SharpGLTF.Geometry
             model.MergeBuffers();
 
             // checks
-            Assert.AreEqual(1, model.LogicalBuffers.Count);
-            Assert.AreEqual(2, model.LogicalBufferViews.Count);
-            Assert.IsTrue(model.LogicalBufferViews[0].IsVertexBuffer);
-            Assert.IsTrue(model.LogicalBufferViews[1].IsIndexBuffer);
-            Assert.AreEqual(2, model.LogicalMaterials.Count);
+            Assert.That(model.LogicalBuffers, Has.Count.EqualTo(1));
+            Assert.That(model.LogicalBufferViews, Has.Count.EqualTo(2));
+            Assert.That(model.LogicalBufferViews[0].IsVertexBuffer);
+            Assert.That(model.LogicalBufferViews[1].IsIndexBuffer);
+            Assert.That(model.LogicalMaterials, Has.Count.EqualTo(2));
 
             model.AttachToCurrentTest("result.glb");
             model.AttachToCurrentTest("result.gltf");
@@ -144,7 +144,7 @@ namespace SharpGLTF.Geometry
 
             var pivot = new NodeBuilder("RootNode").WithLocalTranslation("track1", keyframes);
 
-            Assert.AreEqual(4, pivot.UseTranslation("track1").Keys.Count);
+            Assert.That(pivot.UseTranslation("track1").Keys, Has.Count.EqualTo(4));
 
             // create scene
 

+ 38 - 38
tests/SharpGLTF.Toolkit.Tests/Geometry/MeshBuilderTests.cs

@@ -28,7 +28,7 @@ namespace SharpGLTF.Geometry
             // replaces default preprocessor with a debug preprocessor that throws exceptions at the slightest issue.
             mb.VertexPreprocessor.SetValidationPreprocessors();
 
-            int TriangleCounter() { return mb.Primitives.Sum(item => item.Triangles.Count()); }
+            int TriangleCounter() { return mb.Primitives.Sum(item => item.Triangles.Count); }
 
             var prim = mb.UsePrimitive(m);
 
@@ -48,38 +48,38 @@ namespace SharpGLTF.Geometry
                 .WithSkinning((0, 1));
 
             prim.AddTriangle(a, b, c);
-            Assert.AreEqual(1, TriangleCounter());
+            Assert.That(TriangleCounter(), Is.EqualTo(1));
 
             var v2nan = new Vector2(float.NaN, float.NaN);
             var v3nan = new Vector3(float.NaN, float.NaN, float.NaN);
             var v4nan = new Vector4(float.NaN, float.NaN, float.NaN, float.NaN);
 
             Assert.Throws(typeof(ArgumentException), () => prim.AddTriangle(a.WithGeometry(v3nan), b, c));
-            Assert.AreEqual(1, TriangleCounter());
+            Assert.That(TriangleCounter(), Is.EqualTo(1));
 
             Assert.Throws(typeof(ArgumentException), () => prim.AddTriangle(a.WithGeometry(Vector3.Zero, v3nan), b, c));
-            Assert.AreEqual(1, TriangleCounter());
+            Assert.That(TriangleCounter(), Is.EqualTo(1));
 
             Assert.Throws(typeof(ArgumentOutOfRangeException), () => prim.AddTriangle(a.WithGeometry(Vector3.Zero, Vector3.Zero), b, c));
-            Assert.AreEqual(1, TriangleCounter());            
+            Assert.That(TriangleCounter(), Is.EqualTo(1));            
             
             Assert.Throws(typeof(ArgumentOutOfRangeException), () => prim.AddTriangle(a.WithGeometry(Vector3.Zero, Vector3.UnitX * 0.8f), b, c));
-            Assert.AreEqual(1, TriangleCounter());
+            Assert.That(TriangleCounter(), Is.EqualTo(1));
 
             Assert.Throws(typeof(ArgumentException), () => prim.AddTriangle(a.WithMaterial(v2nan), b, c));
-            Assert.AreEqual(1, TriangleCounter());
+            Assert.That(TriangleCounter(), Is.EqualTo(1));
 
             Assert.Throws(typeof(ArgumentException), () => prim.AddTriangle(a.WithMaterial(v4nan), b, c));
-            Assert.AreEqual(1, TriangleCounter());
+            Assert.That(TriangleCounter(), Is.EqualTo(1));
 
             Assert.Throws(typeof(ArgumentOutOfRangeException), () => prim.AddTriangle(a.WithMaterial(Vector4.One*2), b, c));
-            Assert.AreEqual(1, TriangleCounter());
+            Assert.That(TriangleCounter(), Is.EqualTo(1));
 
             Assert.Throws(typeof(ArgumentOutOfRangeException), () => prim.AddTriangle(a.WithMaterial(-Vector4.One), b, c));
-            Assert.AreEqual(1, TriangleCounter());
+            Assert.That(TriangleCounter(), Is.EqualTo(1));
 
             Assert.Throws(typeof(ArgumentOutOfRangeException), () => prim.AddTriangle(a.WithSkinning((0,0)), b, c));
-            Assert.AreEqual(1, TriangleCounter());
+            Assert.That(TriangleCounter(), Is.EqualTo(1));
         }
 
         [Test]
@@ -145,9 +145,9 @@ namespace SharpGLTF.Geometry
                     new VertexPosition(validTriangle.Item2),
                     new VertexPosition(validTriangle.Item3)
                     );
-            Assert.GreaterOrEqual(validIndices.A, 0);
-            Assert.GreaterOrEqual(validIndices.B, 0);
-            Assert.GreaterOrEqual(validIndices.C, 0);
+            Assert.That(validIndices.A, Is.GreaterThanOrEqualTo(0));
+            Assert.That(validIndices.B, Is.GreaterThanOrEqualTo(0));
+            Assert.That(validIndices.C, Is.GreaterThanOrEqualTo(0));
 
             var degenIndices = mesh.UsePrimitive(material2)
                 .AddTriangle
@@ -156,9 +156,9 @@ namespace SharpGLTF.Geometry
                     new VertexPosition(degeneratedTriangle.Item2),
                     new VertexPosition(degeneratedTriangle.Item3)
                     );
-            Assert.Less(degenIndices.A, 0);
-            Assert.Less(degenIndices.B, 0);
-            Assert.Less(degenIndices.C, 0);
+            Assert.That(degenIndices.A, Is.LessThan(0));
+            Assert.That(degenIndices.B, Is.LessThan(0));
+            Assert.That(degenIndices.C, Is.LessThan(0));
 
             // create scene:
 
@@ -170,7 +170,7 @@ namespace SharpGLTF.Geometry
 
             var model = scene.ToGltf2();
 
-            Assert.AreEqual(1, model.LogicalMeshes[0].Primitives.Count);
+            Assert.That(model.LogicalMeshes[0].Primitives, Has.Count.EqualTo(1));
         }
 
         [Test]
@@ -182,11 +182,11 @@ namespace SharpGLTF.Geometry
             var material2 = Materials.MaterialBuilder.CreateDefault();
             var material3 = Materials.MaterialBuilder.CreateDefault();            
 
-            Assert.IsTrue(Materials.MaterialBuilder.AreEqualByContent(material1, material2));
-            Assert.IsTrue(Materials.MaterialBuilder.AreEqualByContent(material1, material3));
+            Assert.That(Materials.MaterialBuilder.AreEqualByContent(material1, material2), Is.True);
+            Assert.That(Materials.MaterialBuilder.AreEqualByContent(material1, material3), Is.True);
 
-            Assert.AreNotEqual(material1, material2);
-            Assert.AreNotEqual(material1, material3);
+            Assert.That(material2 != material1);
+            Assert.That(material3 != material1);
 
             // MeshBuilder should split primitives by material reference,
             // because in general, materials will not be immutable.
@@ -196,7 +196,7 @@ namespace SharpGLTF.Geometry
             mesh.UsePrimitive(material2, 1).AddPoint(default);
             mesh.UsePrimitive(material3, 1).AddPoint(default);
 
-            Assert.AreEqual(3, mesh.Primitives.Count);
+            Assert.That(mesh.Primitives, Has.Count.EqualTo(3));
 
             // create scene
 
@@ -210,7 +210,7 @@ namespace SharpGLTF.Geometry
             // represent the same material, and coalesce to a single material.
 
             var gltfModel = scene.ToGltf2();                        
-            Assert.AreEqual(1, gltfModel.LogicalMaterials.Count);
+            Assert.That(gltfModel.LogicalMaterials, Has.Count.EqualTo(1));
 
             // since Materials.MaterialBuilder is not immutable we can change the contents,
             // so now, material1, material2 and material3 no longer represent the same material
@@ -219,7 +219,7 @@ namespace SharpGLTF.Geometry
             material3.WithMetallicRoughnessShader().WithChannelParam(Materials.KnownChannel.BaseColor, Materials.KnownProperty.RGBA, Vector4.One * 0.6f);
 
             gltfModel = scene.ToGltf2();            
-            Assert.AreEqual(3, gltfModel.LogicalMaterials.Count);
+            Assert.That(gltfModel.LogicalMaterials, Has.Count.EqualTo(3));
 
         }
 
@@ -233,14 +233,14 @@ namespace SharpGLTF.Geometry
             var triIdx = prim.AddTriangle(new VERTEX1(Vector3.Zero), new VERTEX1(Vector3.UnitX * 2) , new VERTEX1(Vector3.UnitY * 2));
             var qadIdx = prim.AddQuadrangle(new VERTEX1(-Vector3.UnitX), new VERTEX1(Vector3.UnitY), new VERTEX1(Vector3.UnitX), new VERTEX1(-Vector3.UnitY));
 
-            Assert.AreEqual(7, prim.Vertices.Count);
-            Assert.AreEqual(3, prim.Triangles.Count);
-            Assert.AreEqual(2, prim.Surfaces.Count);
+            Assert.That(prim.Vertices, Has.Count.EqualTo(7));
+            Assert.That(prim.Triangles, Has.Count.EqualTo(3));
+            Assert.That(prim.Surfaces, Has.Count.EqualTo(2));
 
-            Assert.AreEqual((0, 1, 2), triIdx);
-            Assert.AreEqual((3, 4, 5, 6), qadIdx);
+            Assert.That(triIdx, Is.EqualTo((0, 1, 2)));
+            Assert.That(qadIdx, Is.EqualTo((3, 4, 5, 6)));
 
-            CollectionAssert.AreEqual(new[] { 0, 1, 2, 3, 4, 5, 3, 5, 6 }, prim.GetIndices());
+            Assert.That(prim.GetIndices(), Is.EqualTo(new[] { 0, 1, 2, 3, 4, 5, 3, 5, 6 }));
         }
 
         [Test]
@@ -263,7 +263,7 @@ namespace SharpGLTF.Geometry
 
             var batchId = dstMesh.Primitives[0].GetVertexAccessor(VertexColor1Texture1Custom1.CUSTOMATTRIBUTENAME).AsScalarArray();
 
-            CollectionAssert.AreEqual(new float[] { 0.1f, 0.2f, 0.3f }, batchId);
+            Assert.That(batchId, Is.EqualTo(new float[] { 0.1f, 0.2f, 0.3f }));
         }
 
         [Test]
@@ -295,10 +295,10 @@ namespace SharpGLTF.Geometry
 
             foreach(var (src, dst) in primitivePairs)
             {
-                Assert.AreNotSame(src.Material, dst.Material);
-                Assert.AreEqual(src.Triangles.Count, dst.Triangles.Count);
+                Assert.That(dst.Material, Is.Not.SameAs(src.Material));
+                Assert.That(dst.Triangles, Has.Count.EqualTo(src.Triangles.Count));
 
-                CollectionAssert.AreEqual(src.Triangles, dst.Triangles);
+                Assert.That(dst.Triangles, Is.EqualTo(src.Triangles));
             }
 
             var material3 = Materials.MaterialBuilder.CreateDefault();
@@ -308,9 +308,9 @@ namespace SharpGLTF.Geometry
             // of the source mesh merged into a single primitive.
             var cloned2 = cloned1.Clone(m => material3);
 
-            Assert.AreEqual(1, cloned2.Primitives.Count);
-            Assert.AreSame(material3, cloned2.Primitives.First().Material);
-            Assert.AreEqual(cloned1.Primitives.Sum(item => item.Triangles.Count), cloned2.Primitives.Sum(item => item.Triangles.Count));
+            Assert.That(cloned2.Primitives.Count, Is.EqualTo(1));
+            Assert.That(cloned2.Primitives.First().Material, Is.SameAs(material3));
+            Assert.That(cloned2.Primitives.Sum(item => item.Triangles.Count), Is.EqualTo(cloned1.Primitives.Sum(item => item.Triangles.Count)));
         }
     }
 }

+ 2 - 2
tests/SharpGLTF.Toolkit.Tests/Geometry/VertexTypes/CustomVertexTests.cs

@@ -16,7 +16,7 @@ namespace SharpGLTF.Geometry.VertexTypes
             var v2 = new VertexCustom2(0.3f, Vector4.One);
             var v1 = new VertexColor1Texture1Custom1(v2);
             
-            Assert.AreEqual(0.3f, v1.CustomId);
+            Assert.That(v1.CustomId, Is.EqualTo(0.3f));
         }
 
         [Test]
@@ -24,7 +24,7 @@ namespace SharpGLTF.Geometry.VertexTypes
         {
             var v1 = new VertexColor1Texture1Custom1(Vector4.One, Vector2.One, 0.3f);
             var v2 = v1.ConvertToMaterial<VertexCustom2>();
-            Assert.AreEqual(0.3f, v2.CustomId0);
+            Assert.That(v2.CustomId0, Is.EqualTo(0.3f));
         }
 
     }

+ 10 - 10
tests/SharpGLTF.Toolkit.Tests/Geometry/VertexTypes/VertexSkinningTests.cs

@@ -30,11 +30,11 @@ namespace SharpGLTF.Geometry.VertexTypes
             var w1 = Transforms.SparseWeight8.CreateUnchecked(new Vector4(3, 2, 1, 0), new Vector4(7, 6, 5, 4), new Vector4(1, 2, 3, 4) * 0.6f, new Vector4(1, 2, 3, 4) * 0.4f);
 
             // the index/weight pairs are ordered diferently...
-            Assert.AreNotEqual(w0.Index0, w1.Index0);
-            Assert.AreNotEqual(w0.Weight0, w1.Weight0);
+            Assert.That(w1.Index0, Is.Not.EqualTo(w0.Index0));
+            Assert.That(w1.Weight0, Is.Not.EqualTo(w0.Weight0));
 
             // but they should be effectively the same.
-            Assert.AreEqual(w0, w1);
+            Assert.That(w1, Is.EqualTo(w0));
 
             var v0 = new VERTEXSKINNED4()
                 .WithGeometry(p)
@@ -44,7 +44,7 @@ namespace SharpGLTF.Geometry.VertexTypes
                 .WithGeometry(p)
                 .WithSkinning(w1);
 
-            Assert.AreEqual(v0, v1);
+            Assert.That(v1, Is.EqualTo(v0));
 
             var v2 = new VERTEXSKINNED8()
                 .WithGeometry(p)
@@ -54,7 +54,7 @@ namespace SharpGLTF.Geometry.VertexTypes
                 .WithGeometry(p)
                 .WithSkinning(w1);
 
-            Assert.AreEqual(v0, v1);
+            Assert.That(v1, Is.EqualTo(v0));
         }
 
         [Test]
@@ -109,12 +109,12 @@ namespace SharpGLTF.Geometry.VertexTypes
 
             var sparse = v4.GetBindings();
 
-            Assert.AreEqual(1, sparse.WeightSum, 0.00001f);
+            Assert.That(sparse.WeightSum, Is.EqualTo(1).Within(0.00001f));
 
-            Assert.AreEqual(0.333333f, sparse[5], 0.00001f);
-            Assert.AreEqual(0.277777f, sparse[3], 0.00001f);
-            Assert.AreEqual(0.222222f, sparse[1], 0.00001f);
-            Assert.AreEqual(0.166666f, sparse[2], 0.00001f);
+            Assert.That(sparse[5], Is.EqualTo(0.333333f).Within(0.00001f));
+            Assert.That(sparse[3], Is.EqualTo(0.277777f).Within(0.00001f));
+            Assert.That(sparse[1], Is.EqualTo(0.222222f).Within(0.00001f));
+            Assert.That(sparse[2], Is.EqualTo(0.166666f).Within(0.00001f));
         }
     }
 }

+ 1 - 1
tests/SharpGLTF.Toolkit.Tests/IO/WavefrontWriterTest.cs

@@ -28,7 +28,7 @@ namespace SharpGLTF.IO
 
             var pngPath = System.IO.Path.ChangeExtension(outPath, ".png");
 
-            Assert.IsTrue(System.IO.File.Exists(pngPath));
+            Assert.That(System.IO.File.Exists(pngPath));
         }
     }
 }

+ 4 - 4
tests/SharpGLTF.Toolkit.Tests/IO/ZipTests.cs

@@ -28,13 +28,13 @@ namespace SharpGLTF.IO
 
             Schema2.ModelRoot model = scene.ToGltf2();
 
-            Assert.AreEqual("SphereMesh", model.LogicalMeshes[0].Name);
-            Assert.AreEqual("Sphere", model.LogicalNodes[0].Name);            
+            Assert.That(model.LogicalMeshes[0].Name, Is.EqualTo("SphereMesh"));
+            Assert.That(model.LogicalNodes[0].Name, Is.EqualTo("Sphere"));            
 
             model = _ZipRoundtrip(model);
 
-            Assert.AreEqual("SphereMesh", model.LogicalMeshes[0].Name);
-            Assert.AreEqual("Sphere", model.LogicalNodes[0].Name);
+            Assert.That(model.LogicalMeshes[0].Name, Is.EqualTo("SphereMesh"));
+            Assert.That(model.LogicalNodes[0].Name, Is.EqualTo("Sphere"));
         }
 
 

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

@@ -32,7 +32,7 @@ namespace SharpGLTF.Materials
 
             var material2 = material1.Clone();
 
-            Assert.IsTrue(MaterialBuilder.AreEqualByContent(material1, material2));
+            Assert.That(MaterialBuilder.AreEqualByContent(material1, material2));
 
             var extras = new System.Text.Json.Nodes.JsonObject();
             extras["hello"] = 1;
@@ -45,16 +45,16 @@ namespace SharpGLTF.Materials
 
             var material3 = material2.Clone();
 
-            Assert.IsFalse(MaterialBuilder.AreEqualByContent(material1, material2));
-            Assert.IsTrue(MaterialBuilder.AreEqualByContent(material2, material3));
+            Assert.That(MaterialBuilder.AreEqualByContent(material1, material2), Is.False);
+            Assert.That(MaterialBuilder.AreEqualByContent(material2, material3), Is.True);
 
             var dict = material3.GetChannel(KnownChannel.BaseColor)
                 .Texture
                 .PrimaryImage
                 .Extras.Deserialize<Dictionary<string,int>>();            
 
-            Assert.AreEqual(1, dict.Count);
-            Assert.AreEqual(1, dict["hello"]);
+            Assert.That(dict, Has.Count.EqualTo(1));
+            Assert.That(dict["hello"], Is.EqualTo(1));
         }
 
         [Test]
@@ -99,7 +99,7 @@ namespace SharpGLTF.Materials
 
             string imageSharingHook(WriteContext ctx, string uri, Memory.MemoryImage image)
             {
-                Assert.IsTrue(new string[] { tex1, tex2 }.Contains(image.SourcePath) );
+                Assert.That(new string[] { tex1, tex2 }, Does.Contain(image.SourcePath));
 
                 if (File.Exists(image.SourcePath))
                 {
@@ -140,14 +140,14 @@ namespace SharpGLTF.Materials
             var satellites2 = ModelRoot.GetSatellitePaths(path2);
             var satellites3 = ModelRoot.GetSatellitePaths(path3);
 
-            Assert.IsTrue(satellites1.Contains("shared-shannon.png"));
-            Assert.IsTrue(satellites1.Contains("subdir/shared-in-dir-Texture1.jpg"));
+            Assert.That(satellites1, Does.Contain("shared-shannon.png"));
+            Assert.That(satellites1, Does.Contain("subdir/shared-in-dir-Texture1.jpg"));
 
-            Assert.IsTrue(satellites2.Contains("shared-shannon.png"));
-            Assert.IsTrue(satellites2.Contains("subdir/shared-in-dir-Texture1.jpg"));
+            Assert.That(satellites2, Does.Contain("shared-shannon.png"));
+            Assert.That(satellites2, Does.Contain("subdir/shared-in-dir-Texture1.jpg"));
 
-            Assert.IsTrue(satellites3.Contains("shared-shannon.png"));
-            Assert.IsTrue(satellites3.Contains("subdir/shared-in-dir-Texture1.jpg"));
+            Assert.That(satellites3, Does.Contain("shared-shannon.png"));
+            Assert.That(satellites3, Does.Contain("subdir/shared-in-dir-Texture1.jpg"));
         }
 
     }

+ 17 - 17
tests/SharpGLTF.Toolkit.Tests/Materials/MaterialBuilderTests.cs

@@ -31,18 +31,18 @@ namespace SharpGLTF.Materials
             var clnMaterial = srcMaterial.Clone();
 
             // srcMaterial and clnMaterial are two different objects, so plain equality checks must apply to reference checks
-            Assert.IsFalse(srcMaterial == clnMaterial);
-            Assert.AreNotEqual(srcMaterial, clnMaterial);
-            Assert.AreNotEqual(srcMaterial.GetHashCode(), clnMaterial.GetHashCode());
+            Assert.That(clnMaterial != srcMaterial);
+            Assert.That(clnMaterial, Is.Not.EqualTo(srcMaterial));
+            Assert.That(clnMaterial.GetHashCode(), Is.Not.EqualTo(srcMaterial.GetHashCode()));
 
             // checking the materials represent the same "material" must be made with AreEqualByContent method.
-            Assert.IsTrue(MaterialBuilder.AreEqualByContent(srcMaterial, clnMaterial));
+            Assert.That(MaterialBuilder.AreEqualByContent(srcMaterial, clnMaterial));
 
             var bag = new HashSet<MaterialBuilder>();
             bag.Add(srcMaterial);
             bag.Add(clnMaterial);
 
-            Assert.AreEqual(2, bag.Count);
+            Assert.That(bag, Has.Count.EqualTo(2));
         }
 
         [Test]
@@ -50,8 +50,8 @@ namespace SharpGLTF.Materials
         {
             var material = _CreateUnlitMaterial();
 
-            Assert.IsTrue(MaterialBuilder.AreEqualByContent(material, _Schema2Roundtrip(material)));
-            Assert.IsTrue(MaterialBuilder.AreEqualByContent(material, material.Clone()));
+            Assert.That(MaterialBuilder.AreEqualByContent(material, _Schema2Roundtrip(material)));
+            Assert.That(MaterialBuilder.AreEqualByContent(material, material.Clone()));
         }        
 
         [Test]
@@ -59,8 +59,8 @@ namespace SharpGLTF.Materials
         {
             var material = _CreateMetallicRoughnessMaterial();
 
-            Assert.IsTrue(MaterialBuilder.AreEqualByContent(material, _Schema2Roundtrip(material)));
-            Assert.IsTrue(MaterialBuilder.AreEqualByContent(material, material.Clone()));
+            Assert.That(MaterialBuilder.AreEqualByContent(material, _Schema2Roundtrip(material)));
+            Assert.That(MaterialBuilder.AreEqualByContent(material, material.Clone()));
         }        
 
         [Test]
@@ -68,8 +68,8 @@ namespace SharpGLTF.Materials
         {
             var material = _CreateClearCoatMaterial();
 
-            Assert.IsTrue(MaterialBuilder.AreEqualByContent(material, _Schema2Roundtrip(material)));
-            Assert.IsTrue(MaterialBuilder.AreEqualByContent(material, material.Clone()));
+            Assert.That(MaterialBuilder.AreEqualByContent(material, _Schema2Roundtrip(material)));
+            Assert.That(MaterialBuilder.AreEqualByContent(material, material.Clone()));
         }        
 
         [Test]
@@ -77,8 +77,8 @@ namespace SharpGLTF.Materials
         {
             var material = _CreateVolumeMaterial();
 
-            Assert.IsTrue(MaterialBuilder.AreEqualByContent(material, _Schema2Roundtrip(material)));
-            Assert.IsTrue(MaterialBuilder.AreEqualByContent(material, material.Clone()));
+            Assert.That(MaterialBuilder.AreEqualByContent(material, _Schema2Roundtrip(material)));
+            Assert.That(MaterialBuilder.AreEqualByContent(material, material.Clone()));
         }        
 
         [Test]
@@ -86,8 +86,8 @@ namespace SharpGLTF.Materials
         {
             var material = _CreateSpecularGlossinessMaterial();
 
-            Assert.IsTrue(MaterialBuilder.AreEqualByContent(material, _Schema2Roundtrip(material)));
-            Assert.IsTrue(MaterialBuilder.AreEqualByContent(material, material.Clone()));
+            Assert.That(MaterialBuilder.AreEqualByContent(material, _Schema2Roundtrip(material)));
+            Assert.That(MaterialBuilder.AreEqualByContent(material, material.Clone()));
         }        
 
         [Test]
@@ -96,8 +96,8 @@ namespace SharpGLTF.Materials
             var material = _CreateSpecularGlossinessMaterialWithFallback();
 
             // check
-            Assert.IsTrue(MaterialBuilder.AreEqualByContent(material, _Schema2Roundtrip(material)));
-            Assert.IsTrue(MaterialBuilder.AreEqualByContent(material, material.Clone()));
+            Assert.That(MaterialBuilder.AreEqualByContent(material, _Schema2Roundtrip(material)), Is.True);
+            Assert.That(MaterialBuilder.AreEqualByContent(material, material.Clone()), Is.True);
         }
 
         private static MaterialBuilder _CreateUnlitMaterial()

+ 1 - 1
tests/SharpGLTF.Toolkit.Tests/Materials/MaterialTypesTests.cs

@@ -16,7 +16,7 @@ namespace SharpGLTF.Materials
             var knownPropertyValues = Enum.GetNames(typeof(KnownProperty));
             var schemaPropertyValues = Enum.GetNames(typeof(Schema2._MaterialParameterKey));            
 
-            CollectionAssert.AreEqual(schemaPropertyValues, knownPropertyValues);
+            Assert.That(schemaPropertyValues, Is.EqualTo(knownPropertyValues));
         }
     }
 }

+ 37 - 37
tests/SharpGLTF.Toolkit.Tests/Scenes/SceneBuilderTests.cs

@@ -69,11 +69,11 @@ namespace SharpGLTF.Scenes
                 .OfType<LightContent>()
                 .ToList();
 
-            Assert.AreEqual(2, lightInstances.Count);
+            Assert.That(lightInstances, Has.Count.EqualTo(2));
 
             var gltf = scene.ToGltf2();
 
-            Assert.AreEqual(2, gltf.LogicalPunctualLights.Count);
+            Assert.That(gltf.LogicalPunctualLights, Has.Count.EqualTo(2));
 
             gltf.AttachToCurrentTest("cube.glb");
             gltf.AttachToCurrentTest("cube.gltf");
@@ -149,28 +149,28 @@ namespace SharpGLTF.Scenes
             var prim = mesh.UsePrimitive(MaterialBuilder.CreateDefault());
 
             var idx = prim.AddQuadrangle(new VertexPosition(0, -1, 0), new VertexPosition(1, 0, 0), new VertexPosition(0, 1, 0), new VertexPosition(-1, 0, 0));
-            Assert.AreEqual((0, 1, 2, 3), idx);
+            Assert.That(idx, Is.EqualTo((0, 1, 2, 3)));
 
             idx = prim.AddQuadrangle(new VertexPosition(0, -1, 1), new VertexPosition(1, 0, 1), new VertexPosition(0, 1, 1), new VertexPosition(0.5f, 0, 1));
-            Assert.AreEqual((4, 5, 6, 7), idx);
+            Assert.That(idx, Is.EqualTo((4, 5, 6, 7)));
 
             idx = prim.AddQuadrangle(new VertexPosition(0, 0.5f, 2), new VertexPosition(1, 0, 2), new VertexPosition(0, 1, 2), new VertexPosition(-1, 0, 2));
-            Assert.AreEqual((8,9,10,11), idx);
+            Assert.That(idx, Is.EqualTo((8,9,10,11)));
 
             idx = prim.AddQuadrangle(new VertexPosition(1, 0, 3), new VertexPosition(0, 1, 3), new VertexPosition(0.5f, 0, 3), new VertexPosition(0, -1, 3));
-            Assert.AreEqual((12,13,14,15), idx);
+            Assert.That(idx, Is.EqualTo((12,13,14,15)));
 
             idx = prim.AddQuadrangle(new VertexPosition(1, 0, 4), new VertexPosition(1, 0, 4), new VertexPosition(0, 1, 4), new VertexPosition(-1, 0, 4));
-            Assert.AreEqual((-1, 16, 17, 18), idx);
+            Assert.That(idx, Is.EqualTo((-1, 16, 17, 18)));
 
             idx = prim.AddQuadrangle(new VertexPosition(1, 0, 4), new VertexPosition(1, 0, 4), new VertexPosition(0, 1, 4), new VertexPosition(0, 1, 4));
-            Assert.AreEqual((-1, -1, -1, -1), idx);
+            Assert.That(idx, Is.EqualTo((-1, -1, -1, -1)));
 
             idx = prim.AddQuadrangle(new VertexPosition(0, 0, 5), new VertexPosition(10, -1, 5), new VertexPosition(9, 0, 5), new VertexPosition(10, 1, 5));
-            Assert.AreEqual((19,20,21,22), idx);
+            Assert.That(idx, Is.EqualTo((19,20,21,22)));
 
             idx = prim.AddQuadrangle(new VertexPosition(10, -1, 6), new VertexPosition(9, 0, 6), new VertexPosition(10, 1, 6), new VertexPosition(0, 0, 6));
-            Assert.AreEqual((23, 24, 25, 26), idx);
+            Assert.That(idx, Is.EqualTo((23, 24, 25, 26)));
 
             var scene = new SceneBuilder();
 
@@ -531,9 +531,9 @@ namespace SharpGLTF.Scenes
 
             var meshIdx = 1;
 
-            Assert.AreEqual(1, gltf.LogicalMeshes[meshIdx].Primitives[0].MorphTargetsCount);
-            Assert.AreEqual(1, gltf.LogicalMeshes[meshIdx].MorphWeights[0]);
-            Assert.AreEqual(1, gltf.LogicalAnimations.Count);
+            Assert.That(gltf.LogicalMeshes[meshIdx].Primitives[0].MorphTargetsCount, Is.EqualTo(1));
+            Assert.That(gltf.LogicalMeshes[meshIdx].MorphWeights[0], Is.EqualTo(1));
+            Assert.That(gltf.LogicalAnimations.Count, Is.EqualTo(1));
 
             scene.AttachToCurrentTest("mopth.glb");
             scene.AttachToCurrentTest("mopth.gltf");
@@ -565,7 +565,7 @@ namespace SharpGLTF.Scenes
             scene.AddRigidMesh(sphere, joint0);
 
             var gltf = scene.ToGltf2();
-            Assert.AreEqual(3, gltf.LogicalNodes.Count);
+            Assert.That(gltf.LogicalNodes.Count, Is.EqualTo(3));
 
             gltf.AttachToCurrentTest("instanced.glb");
             gltf.AttachToCurrentTest("instanced.gltf");
@@ -591,7 +591,7 @@ namespace SharpGLTF.Scenes
                 .FirstOrDefault(item => item.Contains(path));
 
             var srcModel = Schema2.ModelRoot.Load(path, Validation.ValidationMode.TryFix);
-            Assert.NotNull(srcModel);            
+            Assert.That(srcModel, Is.Not.Null);            
 
             // perform roundtrip
 
@@ -612,14 +612,14 @@ namespace SharpGLTF.Scenes
             var rowTris = rowModel.DefaultScene.EvaluateTriangles().ToList();
             var colTris = colModel.DefaultScene.EvaluateTriangles().ToList();
 
-            Assert.AreEqual(srcTris.Count, rowTris.Count);
-            Assert.AreEqual(srcTris.Count, colTris.Count);
+            Assert.That(rowTris, Has.Count.EqualTo(srcTris.Count));
+            Assert.That(colTris, Has.Count.EqualTo(srcTris.Count));
 
             var srcRep = Reporting.ModelReport.CreateReportFrom(srcModel);
             var rowRep = Reporting.ModelReport.CreateReportFrom(rowModel);
             var colRep = Reporting.ModelReport.CreateReportFrom(colModel);
 
-            Assert.AreEqual(srcRep.NumTriangles, rowRep.NumTriangles);
+            Assert.That(rowRep.NumTriangles, Is.EqualTo(srcRep.NumTriangles));
             NumericsAssert.AreEqual(srcRep.Bounds.Min, rowRep.Bounds.Min, 0.0001f);
             NumericsAssert.AreEqual(srcRep.Bounds.Max, rowRep.Bounds.Max, 0.0001f);
 
@@ -662,7 +662,7 @@ namespace SharpGLTF.Scenes
 
             // load the glTF model
             var srcModel = ModelRoot.Load(path, Validation.ValidationMode.TryFix);
-            Assert.NotNull(srcModel);
+            Assert.That(srcModel, Is.Not.Null);
 
             srcModel.AttachToCurrentTest("GearBoxAssy.plotly");
 
@@ -696,7 +696,7 @@ namespace SharpGLTF.Scenes
 
             var schema = sb.ToGltf2();
 
-            Assert.AreEqual(0, schema.LogicalMeshes.Count,"SceneBuilder should detect empty meshes and remove them.");
+            Assert.That(schema.LogicalMeshes.Count, Is.EqualTo(0), "SceneBuilder should detect empty meshes and remove them.");
 
             schema.CreateMesh("Empty2");
 
@@ -716,14 +716,14 @@ namespace SharpGLTF.Scenes
 
             var gltf = sb.ToGltf2();
 
-            Assert.AreEqual(2, gltf.LogicalNodes.Count);
+            Assert.That(gltf.LogicalNodes.Count, Is.EqualTo(2));
 
             // roundtrip
             sb = SceneBuilder.CreateFrom(gltf.DefaultScene);
 
             var instance = sb.Instances.FirstOrDefault(item => item.Name == "Named");
 
-            Assert.NotNull(instance);            
+            Assert.That(instance, Is.Not.Null);            
         }
 
         [Test]
@@ -767,16 +767,16 @@ namespace SharpGLTF.Scenes
 
             var model = scene.ToGltf2();
 
-            Assert.AreEqual(3, model.LogicalMaterials.Count);
-            CollectionAssert.AreEquivalent(new[] { "material0", "material2", "material3" }, model.LogicalMaterials.Select(item => item.Name));
+            Assert.That(model.LogicalMaterials, Has.Count.EqualTo(3));
+            Assert.That(model.LogicalMaterials.Select(item => item.Name), Is.EquivalentTo(new[] { "material0", "material2", "material3" }));
 
-            Assert.AreEqual(2, model.LogicalMeshes.Count);
+            Assert.That(model.LogicalMeshes, Has.Count.EqualTo(2));
 
-            Assert.AreEqual("mesh1", model.LogicalMeshes[0].Name);
-            Assert.AreEqual(2, model.LogicalMeshes[0].Primitives.Count);
+            Assert.That(model.LogicalMeshes[0].Name, Is.EqualTo("mesh1"));
+            Assert.That(model.LogicalMeshes[0].Primitives, Has.Count.EqualTo(2));
 
-            Assert.AreEqual("mesh3", model.LogicalMeshes[1].Name);
-            Assert.AreEqual(1, model.LogicalMeshes[1].Primitives.Count);
+            Assert.That(model.LogicalMeshes[1].Name, Is.EqualTo("mesh3"));
+            Assert.That(model.LogicalMeshes[1].Primitives, Has.Count.EqualTo(1));
 
             // save the model as GLB
 
@@ -988,12 +988,12 @@ namespace SharpGLTF.Scenes
             // convert to SceneBuilder:
 
             var scenes = SceneBuilder.CreateFrom(model1).ToArray();
-            Assert.AreEqual(2, scenes.Length);
+            Assert.That(scenes, Has.Length.EqualTo(2));
 
             var mesh1 = scenes[0].Instances[0].Content.GetGeometryAsset();
             var mesh2 = scenes[1].Instances[0].Content.GetGeometryAsset();
 
-            Assert.AreSame(mesh1, mesh2, "both scenes must share the same MeshBuilder");
+            Assert.That(mesh2, Is.SameAs(mesh1), "both scenes must share the same MeshBuilder");
 
             // convert back to gltf:
 
@@ -1001,9 +1001,9 @@ namespace SharpGLTF.Scenes
 
             // verify the mesh is still shared.
 
-            Assert.AreEqual(2, model2.LogicalScenes.Count);
-            Assert.AreEqual(2, model2.LogicalNodes.Count);
-            Assert.AreEqual(1, model2.LogicalMeshes.Count); // check the mesh is shared between the 2 scenes
+            Assert.That(model2.LogicalScenes, Has.Count.EqualTo(2));
+            Assert.That(model2.LogicalNodes, Has.Count.EqualTo(2));
+            Assert.That(model2.LogicalMeshes, Has.Count.EqualTo(1)); // check the mesh is shared between the 2 scenes
         }
 
         [Test]
@@ -1024,7 +1024,7 @@ namespace SharpGLTF.Scenes
             var scene2 = new SceneBuilder();
             scene2.AddScene(scene1, Matrix4x4.CreateTranslation(4, 0, 0));
 
-            Assert.AreEqual(new Vector3(4, 0, 0), scene2.Instances.First().Content.GetPoseWorldMatrix().Translation);
+            Assert.That(scene2.Instances[0].Content.GetPoseWorldMatrix().Translation, Is.EqualTo(new Vector3(4, 0, 0)));
 
 
             scene2.AddScene(scene1, Matrix4x4.CreateTranslation(2, 0, 0));
@@ -1034,8 +1034,8 @@ namespace SharpGLTF.Scenes
 
             var gltf = scene2.ToGltf2();
 
-            Assert.AreEqual(1, gltf.LogicalMeshes.Count);
-            Assert.AreEqual(3, gltf.LogicalNodes.Count);
+            Assert.That(gltf.LogicalMeshes, Has.Count.EqualTo(1));
+            Assert.That(gltf.LogicalNodes, Has.Count.EqualTo(3));
 
             gltf.AttachToCurrentTest("Three cubes.glb");
         }

+ 3 - 8
tests/SharpGLTF.Toolkit.Tests/SharpGLTF.Toolkit.Tests.csproj

@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
-    <TargetFrameworks>net471;net6.0-windows;net8.0-windows</TargetFrameworks>
+    <TargetFrameworks>net471;net6.0;net8.0</TargetFrameworks>
     <IsPackable>false</IsPackable>
     <RootNamespace>SharpGLTF</RootNamespace>
     <LangVersion>latest</LangVersion>
@@ -15,18 +15,13 @@
     <ProjectReference Include="..\SharpGLTF.NUnit\SharpGLTF.NUnit.csproj" />
   </ItemGroup>
 
-  <ItemGroup>
-
-    <!--
-    <PackageReference Include="Mono.ApiTools.NuGetDiff" Version="1.3.1" />    
-    <PackageReference Include="Mono.ApiTools" Version="5.14.0.2" />
-    -->
+  <ItemGroup>    
 
     <PackageReference Include="NUnit3TestAdapter" Version="4.5.0">
       <PrivateAssets>all</PrivateAssets>
       <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
     </PackageReference>
     <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />    
-  </ItemGroup>  
+  </ItemGroup>
 
 </Project>