Exemplo n.º 1
0
        public void PlayerNameDecodeWithoutPlayer()
        {
            // Define variables
            PlayerNamePacket p1            = new PlayerNamePacket(null, "SomeName");
            string           encodedString = p1.Encode(true);
            PlayerNamePacket p2            = PlayerNamePacket.Decode(encodedString);

            // Check result
            Assert.AreEqual(p1.Player, p2.Player, "Player is not equal");
            Assert.AreEqual(p1.Name, p2.Name, "Name is not equal");
        }
Exemplo n.º 2
0
        public void PlayerNameDecodeWithPlayer()
        {
            // Setup static player list
            Player.TerminatePlayers(); // Clear any data from previous tests
            Player.InitPlayers(4);

            // Define variables
            PlayerNamePacket p1            = new PlayerNamePacket(Player.GetByIndex(2), "SomeName");
            string           encodedString = p1.Encode(true);
            PlayerNamePacket p2            = PlayerNamePacket.Decode(encodedString);

            // Check result
            Assert.AreEqual(p1.Player, p2.Player, "Player is not equal");
            Assert.AreEqual(p1.Name, p2.Name, "Name is not equal");
        }