fix: Fixes flaky tests, formatting, and sequential testing. (#2168)

This commit is contained in:
Kamron Batman 2025-04-30 16:42:38 -07:00 • committed by GitHub
parent 415c7a6bfd
commit 7dbfc9d161
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
60 changed files with 1304 additions and 1289 deletions

View file

@ -8,14 +8,14 @@ public class ArrowPacketTests
[Fact]
public void TestCancelArrow()
{
var expected = new CancelArrow().Compile();
var expected = new CancelArrow().Compile();
var ns = PacketTestUtilities.CreateTestNetState();
ns.SendCancelArrow(0, 0, Serial.Zero);
var ns = PacketTestUtilities.CreateTestNetState();
ns.SendCancelArrow(0, 0, Serial.Zero);
var result = ns.SendPipe.Reader.AvailableToRead();
AssertThat.Equal(result, expected);
}
}
[Theory]
[InlineData(0, 0)]
@ -23,14 +23,14 @@ public class ArrowPacketTests
[InlineData(100000, 100000)]
public void TestSetArrow(int x, int y)
{
var expected = new SetArrow(x, y).Compile();
var expected = new SetArrow(x, y).Compile();
var ns = PacketTestUtilities.CreateTestNetState();
ns.SendSetArrow(x, y, Serial.Zero);
var ns = PacketTestUtilities.CreateTestNetState();
ns.SendSetArrow(x, y, Serial.Zero);
var result = ns.SendPipe.Reader.AvailableToRead();
AssertThat.Equal(result, expected);
}
}
[Theory]
[InlineData(0, 0)]
@ -38,17 +38,17 @@ public class ArrowPacketTests
[InlineData(100000, 100000)]
public void TestCancelArrowHS(int x, int y)
{
Serial serial = (Serial)0x1024;
Serial serial = (Serial)0x1024;
var expected = new CancelArrowHS(x, y, serial).Compile();
var expected = new CancelArrowHS(x, y, serial).Compile();
var ns = PacketTestUtilities.CreateTestNetState();
ns.ProtocolChanges = ProtocolChanges.HighSeas;
ns.SendCancelArrow(x, y, serial);
var ns = PacketTestUtilities.CreateTestNetState();
ns.ProtocolChanges = ProtocolChanges.HighSeas;
ns.SendCancelArrow(x, y, serial);
var result = ns.SendPipe.Reader.AvailableToRead();
AssertThat.Equal(result, expected);
}
}
[Theory]
[InlineData(0, 0)]
@ -56,15 +56,15 @@ public class ArrowPacketTests
[InlineData(100000, 100000)]
public void TestSetArrowHS(int x, int y)
{
Serial serial = (Serial)0x1024;
Serial serial = (Serial)0x1024;
var expected = new SetArrowHS(x, y, serial).Compile();
var expected = new SetArrowHS(x, y, serial).Compile();
var ns = PacketTestUtilities.CreateTestNetState();
ns.ProtocolChanges = ProtocolChanges.HighSeas;
ns.SendSetArrow(x, y, serial);
var ns = PacketTestUtilities.CreateTestNetState();
ns.ProtocolChanges = ProtocolChanges.HighSeas;
ns.SendSetArrow(x, y, serial);
var result = ns.SendPipe.Reader.AvailableToRead();
AssertThat.Equal(result, expected);
}
}
}
}