Esempio n. 1
0
        public void TestAdvancePlayerSecond()
        {
            var players = new List <IPlayer>
            {
                new Player("1", Color.Red),
                new Player("2", Color.Blue),
                new Player("3", Color.Yellow),
                new Player("4", Color.Green)
            };
            var gameService = new GameService();

            gameService.StartGame(players);

            const int piece       = 1;
            const int playerIndex = 2;

            var rolled   = gameService.RollDie(players.ElementAt(playerIndex));
            var position = players.ElementAt(playerIndex).Pieces.ElementAt(piece);

            Assert.Equal(-1, position);

            gameService.Advance(players.ElementAt(playerIndex), piece);

            Assert.Equal(rolled + ColorPositions.StartPosition(players.ElementAt(playerIndex).Color),
                         players.ElementAt(playerIndex).Pieces.ElementAt(piece));
        }