Skip to content

Commit f39de0f

Browse files
committed
Update tests to use Is.Zero for zero value assertions
Replaced Is.EqualTo(0) with Is.Zero in test assertions for improved readability and consistency with NUnit best practices. No functional changes to test logic.
1 parent 74601c4 commit f39de0f

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

AssetRipper.IO.Endian.Tests/EndianSpanReaderTests.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,13 @@ public void ReadBytesExactIsTheSameForBothOverloads(EndianType endianType)
6060
public void ReadBytesWorksForZeroLengthReading(EndianType endianType)
6161
{
6262
EndianSpanReader reader = new EndianSpanReader(default, endianType);
63-
Assert.That(reader.Length, Is.EqualTo(0));
63+
Assert.That(reader.Length, Is.Zero);
6464

65-
Assert.That(reader.ReadBytes(0).Length, Is.EqualTo(0));
66-
Assert.That(reader.ReadBytes(Span<byte>.Empty), Is.EqualTo(0));
67-
Assert.That(reader.ReadBytesExact(0).Length, Is.EqualTo(0));
65+
Assert.That(reader.ReadBytes(0).Length, Is.Zero);
66+
Assert.That(reader.ReadBytes(Span<byte>.Empty), Is.Zero);
67+
Assert.That(reader.ReadBytesExact(0).Length, Is.Zero);
6868
reader.ReadBytes(Span<byte>.Empty);
69-
Assert.That(reader.Position, Is.EqualTo(0));
69+
Assert.That(reader.Position, Is.Zero);
7070
}
7171

7272
[Theory]

AssetRipper.IO.Endian.Tests/EndianSpanTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ public void PositionTest(EndianType endianType)
3737
Assert.That(writer.Position, Is.EqualTo(2 * sizeof(int)));
3838

3939
EndianSpanReader reader = new EndianSpanReader(data, endianType);
40-
Assert.That(reader.Position, Is.EqualTo(0));
41-
Assert.That(reader.ReadInt32(), Is.EqualTo(0));
40+
Assert.That(reader.Position, Is.Zero);
41+
Assert.That(reader.ReadInt32(), Is.Zero);
4242
Assert.That(reader.Position, Is.EqualTo(sizeof(int)));
4343
int value2 = reader.ReadInt32();
4444
Assert.That(reader.Position, Is.EqualTo(2 * sizeof(int)));

0 commit comments

Comments
 (0)