コード例 #1
0
        public void Game_Serialize_SerializesObject()
        {
            GameApp game = new GameApp(null);

            // Create things to test
            game.AddCharacter(new CharacterEnemy(CharacterClass.Tank, 0));
            game.AddCharacter(new CharacterEnemy(CharacterClass.Support, 0));
            game.AddPlayer(new CharacterPlayer(CharacterClass.Support, 0));

            string serialized = game.Serialize();

            Assert.IsTrue(serialized == "PlayerCharacter;Characters;Pickups;Bullets");
        }
コード例 #2
0
        public void AddCharacter_Valid()
        {
            GameApp game = new GameApp(null);

            game.AddCharacter(new CharacterEnemy(CharacterClass.Support, 20));

            Assert.IsTrue(game.PlayerCharacter == null);
            Assert.IsTrue(game.Characters.Count == 1);
        }