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

38 lines
826 B
C#

using ObjectPPtrAccessList = AssetRipper.Assets.Generics.PPtrAccessList<AssetRipper.Assets.Metadata.IPPtr<AssetRipper.Assets.IUnityObjectBase>, AssetRipper.Assets.IUnityObjectBase>;
namespace AssetRipper.Assets.Tests;
internal class PPtrAccessListTests
{
[Test]
public void EmptyListIsImmutable()
{
using (Assert.EnterMultipleScope())
{
Assert.Throws<NotSupportedException>(() =>
{
ObjectPPtrAccessList.Empty.Add(null);
});
Assert.Throws<NotSupportedException>(() =>
{
ObjectPPtrAccessList.Empty.AddNew();
});
}
}
[Test]
public void EmptyListIsEmpty()
{
Assert.That(ObjectPPtrAccessList.Empty, Is.Empty);
}
[Test]
public void EmptyListThrowsForAccessingFirstElement()
{
Assert.Throws<ArgumentOutOfRangeException>(() =>
{
_ = ObjectPPtrAccessList.Empty[0];
});
}
}