Esempio n. 1
0
        public void TestMobileManaN()
        {
            var m = new Mobile(0x1);

            m.DefaultMobileInit();

            var data = new MobileManaN(m).Compile();

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

            expectedData.Write(ref pos, (byte)0xA2); // Packet ID
            expectedData.Write(ref pos, m.Serial);
            expectedData.WriteAttribute(ref pos, m.Mana, m.ManaMax, true);

            AssertThat.Equal(data, expectedData);
        }
Esempio n. 2
0
        public void TestMobileManaN()
        {
            var m = new Mobile(0x1);

            m.DefaultMobileInit();
            m.Int  = 75;
            m.Mana = 100;

            var expected = new MobileManaN(m).Compile();

            using var ns = PacketTestUtilities.CreateTestNetState();
            ns.SendMobileMana(m, true);

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

            AssertThat.Equal(result.Buffer[0].AsSpan(0), expected);
        }