public void TestMovementAck() { var m = new Mobile(0x1); m.DefaultMobileInit(); const byte seq = 100; var expected = MovementAck.Instantiate(seq, m).Compile(); using var ns = PacketTestUtilities.CreateTestNetState(); ns.SendMovementAck(seq, m); var result = ns.SendPipe.Reader.TryRead(); AssertThat.Equal(result.Buffer[0].AsSpan(0), expected); }
public void TestMovementAck() { var m = new Mobile(0x1); m.DefaultMobileInit(); const byte seq = 100; var noto = Notoriety.Compute(m, m); var data = MovementAck.Instantiate(seq, m).Compile(); Span <byte> expectedData = stackalloc byte[3]; var pos = 0; expectedData.Write(ref pos, (byte)0x22); // Packet ID expectedData.Write(ref pos, seq); expectedData.Write(ref pos, (byte)noto); AssertThat.Equal(data, expectedData); }