public void TestDeathAnimation() { Serial killed = 0x1; Serial corpse = 0x1000; var expected = new DeathAnimation(killed, corpse).Compile(); using var ns = PacketTestUtilities.CreateTestNetState(); ns.SendDeathAnimation(killed, corpse); var result = ns.SendPipe.Reader.TryRead(); AssertThat.Equal(result.Buffer[0].AsSpan(0), expected); }
public void TestDeathAnimation() { Serial killed = 0x1; Serial corpse = 0x1000; var data = new DeathAnimation(killed, corpse).Compile(); Span <byte> expectedData = stackalloc byte[13]; var pos = 0; expectedData.Write(ref pos, (byte)0xAF); // Packet ID expectedData.Write(ref pos, killed); expectedData.Write(ref pos, corpse); #if NO_LOCAL_INIT expectedData.Write(ref pos, 0); #endif AssertThat.Equal(data, expectedData); }