Пример #1
0
        public void NoNpc()
        {
            var server = Mock.Server();
            var p      = Mock.Player("xd", server).Get();

            var h = new TalkToPacketHandler(server.Services);
            var b = new Blob(sizeof(short));

            b.Write16(5);

            h.HandleAll(p, o => PacketMessage.Success((byte)o, b));
        }
Пример #2
0
        public void WrongNpc()
        {
            var server = Mock.Server();
            var p      = Mock.Player("xd", server);
            var npc    = Mock.Npc(server, Mock.Invariant, 5, "test npc").Get();

            var h = new TalkToPacketHandler(server.Services);
            var b = new Blob(sizeof(short));

            b.Write16(1234);

            h.HandleAll(p.Get(), o => PacketMessage.Success((byte)o, b));
        }
Пример #3
0
        public void ValidNpc()
        {
            var server = Mock.Server();
            var p      = Mock.Player("xd", server).Get();
            var npc    = Mock.Npc(server, Mock.Invariant, 1, "testnpc").Get();

            var h = new TalkToPacketHandler(server.Services);
            var b = new Blob(sizeof(short));

            b.Write16(npc.AssertGetNpc().InstanceId);

            h.HandleAll(p, o => PacketMessage.Success((byte)o, b));
        }