示例#1
0
        public void TestChangeCombatant()
        {
            Serial serial = 0x1024;

            var expected = new ChangeCombatant(serial).Compile();

            using var ns = PacketTestUtilities.CreateTestNetState();
            ns.SendChangeCombatant(serial);

            var result = ns.SendPipe.Reader.TryRead();

            AssertThat.Equal(result.Buffer[0].AsSpan(0), expected);
        }
        public void TestChangeCombatant()
        {
            Serial combatant = 0x1000;

            var data = new ChangeCombatant(combatant).Compile();

            Span <byte> expectedData = stackalloc byte[5];
            var         pos          = 0;

            expectedData.Write(ref pos, (byte)0xAA); // Packet ID
            expectedData.Write(ref pos, combatant);

            AssertThat.Equal(data, expectedData);
        }