ds5678 a9f01e0536 Refactor assertions to use EnterMultipleScope
Replaced `Assert.Multiple` with `using (Assert.EnterMultipleScope())` in various test methods across multiple test classes. This change improves the readability and structure of assertions, allowing for better management of multiple assertions within a single test case. Affected classes include `AssetResolutionTests`, `FileResolutionTests`, `PPtrTests`, `SmartStreamTests`, and others, enhancing the organization of test result outputs.
2025-06-23 00:05:28 -07:00

42 lines
1.0 KiB
C#

using AssetRipper.SourceGenerated.Extensions;
namespace AssetRipper.Tests;
internal class UVInfoTests
{
[Test]
public void GetReturnsTheSetValue()
{
const int index = 0;
const bool exists = true;
const int dimension = 2;
UVInfo uvInfo = new UVInfo().AddChannelInfo(index, exists, dimension);
uvInfo.GetChannelInfo(index, out bool actualExists, out int actualDimension);
using (Assert.EnterMultipleScope())
{
Assert.That(actualExists, Is.EqualTo(exists));
Assert.That(actualDimension, Is.EqualTo(dimension));
}
}
[Test]
public void GetReturnsTheSetValues()
{
const int dimension = 2;
UVInfo uvInfo = default;
for (int i = 0; i < 8; i++)
{
uvInfo = uvInfo.AddChannelInfo(i, i % 2 == 0, dimension);
}
for (int i = 0; i < 8; i++)
{
uvInfo.GetChannelInfo(i, out bool actualExists, out int actualDimension);
using (Assert.EnterMultipleScope())
{
Assert.That(actualExists, Is.EqualTo(i % 2 == 0));
Assert.That(actualDimension, Is.EqualTo(dimension));
}
}
}
}