fix: Fixes flaky tests, formatting, and sequential testing. (#2168)
This commit is contained in:
parent
415c7a6bfd
commit
7dbfc9d161
60 changed files with 1304 additions and 1289 deletions
|
|
@ -7,7 +7,8 @@ using Xunit;
|
|||
|
||||
namespace Server.Tests.Network;
|
||||
|
||||
public class AccountPacketTests : IClassFixture<ServerFixture>
|
||||
[Collection("Sequential Server Tests")]
|
||||
public class AccountPacketTests
|
||||
{
|
||||
private class MockedAccount : IAccount
|
||||
{
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@ using Xunit;
|
|||
|
||||
namespace Server.Tests.Network
|
||||
{
|
||||
[Collection("Sequential Tests")]
|
||||
public class ContainerPacketTests : IClassFixture<ServerFixture>
|
||||
[Collection("Sequential Server Tests")]
|
||||
public class ContainerPacketTests
|
||||
{
|
||||
|
||||
[Fact]
|
||||
|
|
|
|||
|
|
@ -3,7 +3,8 @@ using Xunit;
|
|||
|
||||
namespace Server.Tests.Network
|
||||
{
|
||||
public class DamagePacketTests : IClassFixture<ServerFixture>
|
||||
[Collection("Sequential Server Tests")]
|
||||
public class DamagePacketTests
|
||||
{
|
||||
[Theory, InlineData(10), InlineData(-5), InlineData(1024)]
|
||||
public void TestDamagePacketOld(int inputAmount)
|
||||
|
|
|
|||
|
|
@ -4,7 +4,8 @@ using Xunit;
|
|||
|
||||
namespace Server.Tests.Network
|
||||
{
|
||||
public class EquipmentPacketTests : IClassFixture<ServerFixture>
|
||||
[Collection("Sequential Server Tests")]
|
||||
public class EquipmentPacketTests
|
||||
{
|
||||
[Theory]
|
||||
[InlineData(null, false)]
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@ using Xunit;
|
|||
|
||||
namespace Server.Tests.Network;
|
||||
|
||||
[Collection("Sequential Tests")]
|
||||
public class GumpPacketTests : IClassFixture<ServerFixture>
|
||||
[Collection("Sequential Server Tests")]
|
||||
public class GumpPacketTests
|
||||
{
|
||||
[Theory]
|
||||
[InlineData(100, 10)]
|
||||
|
|
|
|||
|
|
@ -3,7 +3,8 @@ using Xunit;
|
|||
|
||||
namespace Server.Tests.Network
|
||||
{
|
||||
public class ItemPacketTests : IClassFixture<ServerFixture>
|
||||
[Collection("Sequential Server Tests")]
|
||||
public class ItemPacketTests
|
||||
{
|
||||
[Fact]
|
||||
public void TestWorldItemPacket()
|
||||
|
|
|
|||
|
|
@ -3,7 +3,8 @@ using Xunit;
|
|||
|
||||
namespace Server.Tests.Network
|
||||
{
|
||||
public class MapPatchesTests : IClassFixture<ServerFixture>
|
||||
[Collection("Sequential Server Tests")]
|
||||
public class MapPatchesTests
|
||||
{
|
||||
[Fact]
|
||||
public void TestMapPatches()
|
||||
|
|
|
|||
|
|
@ -27,8 +27,8 @@ namespace Server.Tests.Network
|
|||
}
|
||||
}
|
||||
|
||||
[Collection("Sequential Tests")]
|
||||
public class MenuPacketTests : IClassFixture<ServerFixture>
|
||||
[Collection("Sequential Server Tests")]
|
||||
public class MenuPacketTests
|
||||
{
|
||||
[Fact]
|
||||
public void TestDisplayItemListMenu()
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@ using Xunit;
|
|||
|
||||
namespace Server.Tests.Network;
|
||||
|
||||
[Collection("Sequential Tests")]
|
||||
public class MobilePacketTests : IClassFixture<ServerFixture>
|
||||
[Collection("Sequential Server Tests")]
|
||||
public class MobilePacketTests
|
||||
{
|
||||
[Fact]
|
||||
public void TestDeathAnimation()
|
||||
|
|
|
|||
|
|
@ -3,7 +3,8 @@ using Xunit;
|
|||
|
||||
namespace Server.Tests.Network
|
||||
{
|
||||
public class MovementPacketTests : IClassFixture<ServerFixture>
|
||||
[Collection("Sequential Server Tests")]
|
||||
public class MovementPacketTests
|
||||
{
|
||||
[Theory]
|
||||
[InlineData(0)]
|
||||
|
|
|
|||
|
|
@ -5,8 +5,8 @@ using Xunit;
|
|||
|
||||
namespace Server.Tests.Network
|
||||
{
|
||||
[Collection("Sequential Tests")]
|
||||
public class PlayerPacketTests : IClassFixture<ServerFixture>
|
||||
[Collection("Sequential Server Tests")]
|
||||
public class PlayerPacketTests
|
||||
{
|
||||
[Theory]
|
||||
[InlineData(StatLockType.Down, StatLockType.Up, StatLockType.Locked)]
|
||||
|
|
|
|||
|
|
@ -4,7 +4,8 @@ using Xunit;
|
|||
|
||||
namespace Server.Tests.Network
|
||||
{
|
||||
public class SecureTradePacketTests : IClassFixture<ServerFixture>
|
||||
[Collection("Sequential Server Tests")]
|
||||
public class SecureTradePacketTests
|
||||
{
|
||||
[Theory]
|
||||
[InlineData("short-name")]
|
||||
|
|
|
|||
|
|
@ -5,8 +5,8 @@ using Xunit;
|
|||
|
||||
namespace Server.Tests.Network
|
||||
{
|
||||
[Collection("Sequential Tests")]
|
||||
public class VendorBuyPacketTests : IClassFixture<ServerFixture>
|
||||
[Collection("Sequential Server Tests")]
|
||||
public class VendorBuyPacketTests
|
||||
{
|
||||
[Theory]
|
||||
[InlineData(ProtocolChanges.None)]
|
||||
|
|
|
|||
|
|
@ -5,8 +5,8 @@ using Xunit;
|
|||
|
||||
namespace Server.Tests.Network
|
||||
{
|
||||
[Collection("Sequential Tests")]
|
||||
public class VendorSellPacketTests : IClassFixture<ServerFixture>
|
||||
[Collection("Sequential Server Tests")]
|
||||
public class VendorSellPacketTests
|
||||
{
|
||||
[Fact]
|
||||
public void TestVendorSellList()
|
||||
|
|
|
|||
|
|
@ -2,40 +2,40 @@ using Server.Network;
|
|||
using Server.Tests.Network;
|
||||
using Xunit;
|
||||
|
||||
namespace Server.Tests
|
||||
namespace Server.Tests;
|
||||
|
||||
[Collection("Sequential Server Tests")]
|
||||
public class VirtualHairPacketTests
|
||||
{
|
||||
public class VirtualHairPacketTests: IClassFixture<ServerFixture>
|
||||
[Fact]
|
||||
public void TestSendVirtualHairUpdate()
|
||||
{
|
||||
[Fact]
|
||||
public void TestSendVirtualHairUpdate()
|
||||
{
|
||||
var m = new Mobile((Serial)0x1024u);
|
||||
m.DefaultMobileInit();
|
||||
m.HairHue = 0x1000;
|
||||
m.HairItemID = 0x2000;
|
||||
var m = new Mobile((Serial)0x1024u);
|
||||
m.DefaultMobileInit();
|
||||
m.HairHue = 0x1000;
|
||||
m.HairItemID = 0x2000;
|
||||
|
||||
var expected = new HairEquipUpdate(m).Compile();
|
||||
var expected = new HairEquipUpdate(m).Compile();
|
||||
|
||||
var ns = PacketTestUtilities.CreateTestNetState();
|
||||
ns.SendHairEquipUpdatePacket(m, (uint)m.Hair.VirtualSerial, m.Hair.ItemId, m.Hair.Hue, Layer.Hair);
|
||||
var ns = PacketTestUtilities.CreateTestNetState();
|
||||
ns.SendHairEquipUpdatePacket(m, (uint)m.Hair.VirtualSerial, m.Hair.ItemId, m.Hair.Hue, Layer.Hair);
|
||||
|
||||
var result = ns.SendPipe.Reader.AvailableToRead();
|
||||
AssertThat.Equal(result, expected);
|
||||
}
|
||||
var result = ns.SendPipe.Reader.AvailableToRead();
|
||||
AssertThat.Equal(result, expected);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TestSendRemoveVirtualHair()
|
||||
{
|
||||
var m = new Mobile((Serial)0x1024u);
|
||||
m.DefaultMobileInit();
|
||||
[Fact]
|
||||
public void TestSendRemoveVirtualHair()
|
||||
{
|
||||
var m = new Mobile((Serial)0x1024u);
|
||||
m.DefaultMobileInit();
|
||||
|
||||
var expected = new RemoveHair(m).Compile();
|
||||
var expected = new RemoveHair(m).Compile();
|
||||
|
||||
var ns = PacketTestUtilities.CreateTestNetState();
|
||||
ns.SendRemoveHairPacket((uint) m.Hair.VirtualSerial);
|
||||
var ns = PacketTestUtilities.CreateTestNetState();
|
||||
ns.SendRemoveHairPacket((uint) m.Hair.VirtualSerial);
|
||||
|
||||
var result = ns.SendPipe.Reader.AvailableToRead();
|
||||
AssertThat.Equal(result, expected);
|
||||
}
|
||||
var result = ns.SendPipe.Reader.AvailableToRead();
|
||||
AssertThat.Equal(result, expected);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue