예제 #1
0
        public void UpdateTest()
        {
            PlayerModel player     = PlayerControllerMock.GetPlayerModel();
            GameBoard   board      = BoardTest.CreateTestMap();
            var         scoreboard = new Scoreboard(new System.Collections.Generic.List <PlayerModel>()
            {
                player
            }, board);

            board.Board[0, 0].Owner = player;

            scoreboard.Update(null, null);

            Assert.IsTrue(player.Stats.Territory == 1);
        }
예제 #2
0
        public void CreateUseAndRemoveActorTest()
        {
            var player  = new PlayerControllerMock();
            var actors  = new ActorList();
            var mapping = new Dictionary <PlayerCommand, Keys> {
                { PlayerCommand.Up, Keys.A }
            };
            var kState = new KeyboardState(Keys.A);

            actors.Actors.Add(new KeyboardActor(mapping, player));

            actors.Actors[0].PollKeyboard(kState);
            Assert.IsTrue(player.DirChanged == 1);

            actors.RemoveActor(player.Player);
            Assert.IsTrue(actors.Actors.Count == 0);
        }