mirror of
https://github.com/AssetRipper/AssetRipper.git
synced 2025-12-11 20:15:29 +01:00
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.
38 lines
826 B
C#
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];
|
|
});
|
|
}
|
|
}
|