fix(core): Converts virtual hair packets (#388)
- [X] Converts virtual hair packets
This commit is contained in:
parent
30ef0761cb
commit
0912876f7c
11 changed files with 214 additions and 86 deletions
|
|
@ -0,0 +1,40 @@
|
|||
using System;
|
||||
using Server.Network;
|
||||
using Server.Tests.Network;
|
||||
using Xunit;
|
||||
|
||||
namespace Server.Tests
|
||||
{
|
||||
public class VirtualHairPacketTests: IClassFixture<ServerFixture>
|
||||
{
|
||||
[Fact]
|
||||
public void TestSendVirtualHairUpdate()
|
||||
{
|
||||
var m = new Mobile(0x1024u);
|
||||
m.DefaultMobileInit();
|
||||
|
||||
var expected = new HairEquipUpdate(m).Compile();
|
||||
|
||||
using var ns = PacketTestUtilities.CreateTestNetState();
|
||||
ns.SendHairEquipUpdatePacket(m, HairInfo.FakeSerial(m.Serial), Layer.Hair);
|
||||
|
||||
var result = ns.SendPipe.Reader.TryRead();
|
||||
AssertThat.Equal(result.Buffer[0].AsSpan(0), expected);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TestSendRemoveVirtualHair()
|
||||
{
|
||||
var m = new Mobile(0x1024u);
|
||||
m.DefaultMobileInit();
|
||||
|
||||
var expected = new RemoveHair(m).Compile();
|
||||
|
||||
using var ns = PacketTestUtilities.CreateTestNetState();
|
||||
ns.SendRemoveHairPacket(HairInfo.FakeSerial(m.Serial));
|
||||
|
||||
var result = ns.SendPipe.Reader.TryRead();
|
||||
AssertThat.Equal(result.Buffer[0].AsSpan(0), expected);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue