Skip to content

Commit

Permalink
RenderTests: Assert.LessOrEqual to ClassicAssert.LessOrEqual
Browse files Browse the repository at this point in the history
  • Loading branch information
RedImp1470 committed Mar 14, 2024
1 parent f7dcf49 commit 08c1cb5
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions src/Tests/Render/Desktop/RenderTests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using NUnit.Framework;
using NUnit.Framework.Legacy;
using SixLabors.ImageSharp;
using SixLabors.ImageSharp.PixelFormats;
using System.Diagnostics;
Expand Down Expand Up @@ -34,7 +35,7 @@ public void AdvancedUITest()
var result = CompareImage(referenceImagePath, testImagePath);

TestContext.WriteLine($"Number of pixels: {result.pixelCount}\nNumber of different pixels: {result.differentPixelCount}\nAverage difference: {result.averageDifference}\nMaximum difference: {result.maximumDifference}\n");
Assert.LessOrEqual(result.averageDifference, 0.01f);
ClassicAssert.LessOrEqual(result.averageDifference, 0.01f);
}

[Test]
Expand All @@ -46,7 +47,7 @@ public void CameraTest()
var result = CompareImage(referenceImagePath, testImagePath);

TestContext.WriteLine($"Number of pixels: {result.pixelCount}\nNumber of different pixels: {result.differentPixelCount}\nAverage difference: {result.averageDifference}\nMaximum difference: {result.maximumDifference}\n");
Assert.LessOrEqual(result.averageDifference, 0.01f);
ClassicAssert.LessOrEqual(result.averageDifference, 0.01f);
}

[Test]
Expand All @@ -58,7 +59,7 @@ public void FractalTest()
var result = CompareImage(referenceImagePath, testImagePath);

TestContext.WriteLine($"Number of pixels: {result.pixelCount}\nNumber of different pixels: {result.differentPixelCount}\nAverage difference: {result.averageDifference}\nMaximum difference: {result.maximumDifference}\n");
Assert.LessOrEqual(result.averageDifference, 0.01f);
ClassicAssert.LessOrEqual(result.averageDifference, 0.01f);
}

[Test]
Expand All @@ -70,7 +71,7 @@ public void DeferredTest()
var result = CompareImage(referenceImagePath, testImagePath);

TestContext.WriteLine($"Number of pixels: {result.pixelCount}\nNumber of different pixels: {result.differentPixelCount}\nAverage difference: {result.averageDifference}\nMaximum difference: {result.maximumDifference}\n");
Assert.LessOrEqual(result.averageDifference, 0.01f);
ClassicAssert.LessOrEqual(result.averageDifference, 0.01f);
}

[Test]
Expand All @@ -82,7 +83,7 @@ public void GeometryEditingTest()
var result = CompareImage(referenceImagePath, testImagePath);

TestContext.WriteLine($"Number of pixels: {result.pixelCount}\nNumber of different pixels: {result.differentPixelCount}\nAverage difference: {result.averageDifference}\nMaximum difference: {result.maximumDifference}\n");
Assert.LessOrEqual(result.averageDifference, 0.01f);
ClassicAssert.LessOrEqual(result.averageDifference, 0.01f);
}

[Test]
Expand All @@ -94,7 +95,7 @@ public void LabyrinthTest()
var result = CompareImage(referenceImagePath, testImagePath);

TestContext.WriteLine($"Number of pixels: {result.pixelCount}\nNumber of different pixels: {result.differentPixelCount}\nAverage difference: {result.averageDifference}\nMaximum difference: {result.maximumDifference}\n");
Assert.LessOrEqual(result.averageDifference, 0.01f);
ClassicAssert.LessOrEqual(result.averageDifference, 0.01f);
}

[Test]
Expand All @@ -106,7 +107,7 @@ public void MaterialsTest()
var result = CompareImage(referenceImagePath, testImagePath);

TestContext.WriteLine($"Number of pixels: {result.pixelCount}\nNumber of different pixels: {result.differentPixelCount}\nAverage difference: {result.averageDifference}\nMaximum difference: {result.maximumDifference}\n");
Assert.LessOrEqual(result.averageDifference, 0.01f);
ClassicAssert.LessOrEqual(result.averageDifference, 0.01f);
}

[Test]
Expand All @@ -118,7 +119,7 @@ public void MeshingAroundTest()
var result = CompareImage(referenceImagePath, testImagePath);

TestContext.WriteLine($"Number of pixels: {result.pixelCount}\nNumber of different pixels: {result.differentPixelCount}\nAverage difference: {result.averageDifference}\nMaximum difference: {result.maximumDifference}\n");
Assert.LessOrEqual(result.averageDifference, 0.01f);
ClassicAssert.LessOrEqual(result.averageDifference, 0.01f);
}

[Test]
Expand All @@ -130,7 +131,7 @@ public void PickingTest()
var result = CompareImage(referenceImagePath, testImagePath);

TestContext.WriteLine($"Number of pixels: {result.pixelCount}\nNumber of different pixels: {result.differentPixelCount}\nAverage difference: {result.averageDifference}\nMaximum difference: {result.maximumDifference}\n");
Assert.LessOrEqual(result.averageDifference, 0.01f);
ClassicAssert.LessOrEqual(result.averageDifference, 0.01f);
}

[Test]
Expand All @@ -142,7 +143,7 @@ public void PointCloudPotree2Test()
var result = CompareImage(referenceImagePath, testImagePath);

TestContext.WriteLine($"Number of pixels: {result.pixelCount}\nNumber of different pixels: {result.differentPixelCount}\nAverage difference: {result.averageDifference}\nMaximum difference: {result.maximumDifference}\n");
Assert.LessOrEqual(result.averageDifference, 0.01f);
ClassicAssert.LessOrEqual(result.averageDifference, 0.01f);
}

[Test]
Expand All @@ -154,7 +155,7 @@ public void RenderContextOnlyTest()
var result = CompareImage(referenceImagePath, testImagePath);

TestContext.WriteLine($"Number of pixels: {result.pixelCount}\nNumber of different pixels: {result.differentPixelCount}\nAverage difference: {result.averageDifference}\nMaximum difference: {result.maximumDifference}\n");
Assert.LessOrEqual(result.averageDifference, 0.01f);
ClassicAssert.LessOrEqual(result.averageDifference, 0.01f);
}

[Test]
Expand All @@ -166,7 +167,7 @@ public void RenderLayerTest()
var result = CompareImage(referenceImagePath, testImagePath);

TestContext.WriteLine($"Number of pixels: {result.pixelCount}\nNumber of different pixels: {result.differentPixelCount}\nAverage difference: {result.averageDifference}\nMaximum difference: {result.maximumDifference}\n");
Assert.LessOrEqual(result.averageDifference, 0.01f);
ClassicAssert.LessOrEqual(result.averageDifference, 0.01f);
}

[Test]
Expand All @@ -178,7 +179,7 @@ public void SimpleTest()
var result = CompareImage(referenceImagePath, testImagePath);

TestContext.WriteLine($"Number of pixels: {result.pixelCount}\nNumber of different pixels: {result.differentPixelCount}\nAverage difference: {result.averageDifference}\nMaximum difference: {result.maximumDifference}\n");
Assert.LessOrEqual(result.averageDifference, 0.01f);
ClassicAssert.LessOrEqual(result.averageDifference, 0.01f);
}

[Test]
Expand All @@ -190,7 +191,7 @@ public void ThreeDFontTest()
var result = CompareImage(referenceImagePath, testImagePath);

TestContext.WriteLine($"Number of pixels: {result.pixelCount}\nNumber of different pixels: {result.differentPixelCount}\nAverage difference: {result.averageDifference}\nMaximum difference: {result.maximumDifference}\n");
Assert.LessOrEqual(result.averageDifference, 0.01f);
ClassicAssert.LessOrEqual(result.averageDifference, 0.01f);
}

[Test]
Expand All @@ -202,7 +203,7 @@ public void UITest()
var result = CompareImage(referenceImagePath, testImagePath);

TestContext.WriteLine($"Number of pixels: {result.pixelCount}\nNumber of different pixels: {result.differentPixelCount}\nAverage difference: {result.averageDifference}\nMaximum difference: {result.maximumDifference}\n");
Assert.LessOrEqual(result.averageDifference, 0.01f);
ClassicAssert.LessOrEqual(result.averageDifference, 0.01f);
}

/// <summary>
Expand Down

0 comments on commit 08c1cb5

Please sign in to comment.