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)); }
public void GetStartPositionYellow() { const Color color = Color.Yellow; var startPosition = ColorPositions.StartPosition(color); Assert.Equal(20, startPosition); }
public void GetStartPositionRed() { const Color color = Color.Red; var startPosition = ColorPositions.StartPosition(color); Assert.Equal(0, startPosition); }
public void GetStartPositionGreen() { const Color color = Color.Green; var startPosition = ColorPositions.StartPosition(color); Assert.Equal(30, startPosition); }
public void GetStartPositionBlue() { const Color color = Color.Blue; var startPosition = ColorPositions.StartPosition(color); Assert.Equal(10, startPosition); }
public void GetStartPositionUnknown() { const Color color = (Color)5; Assert.Throws <IndexOutOfRangeException>(() => ColorPositions.StartPosition(color)); }