public void AddPiecesWithPlayer_TwoPlayers_AllPiecesAreAtPosition() { // Arrange LudoPlayer lp1 = new LudoPlayer(); LudoPlayer lp2 = new LudoPlayer(); GameBoard sut = new GameBoard(); // Act sut.AddPiecesWithPlayer(lp1); sut.AddPiecesWithPlayer(lp2); // Assert Assert.Equal(-1, sut.Pieces[0].TileId); Assert.Equal(-2, sut.Pieces[1].TileId); Assert.Equal(-3, sut.Pieces[2].TileId); Assert.Equal(-4, sut.Pieces[3].TileId); Assert.Equal(-1, sut.Pieces[4].TileId); Assert.Equal(-2, sut.Pieces[5].TileId); Assert.Equal(-3, sut.Pieces[6].TileId); Assert.Equal(-4, sut.Pieces[7].TileId); }
public void GetAvaiablePieces_PlayerIsInHome_NumberOfPiecesWhichCanBeMovedOutOfHome(int diceRollValue, int expectedAvaiablePieces) { // Arrange LudoPlayer lp1 = new LudoPlayer("player1"); GameBoard gb = new GameBoard(); gb.AddPiecesWithPlayer(lp1); var sut = new PlayerTurn(lp1, gb); // Act Piece[] pieces = sut.GetAvaiablePieces(diceRollValue); // Assert Assert.Equal(expectedAvaiablePieces, pieces.Length); }
public void GetAvaiablePieces_PlayerHaveAllPiecesOnBoard_NumberOfPiecesWhichCanBeMoved(int diceRollValue, int expectedAvaiablePieces) { // Arrange LudoPlayer lp1 = new LudoPlayer("player1"); GameBoard gb = new GameBoard(); gb.AddPiecesWithPlayer(lp1); gb.Pieces[0].TileId = 0; gb.Pieces[1].TileId = 1; gb.Pieces[2].TileId = 2; gb.Pieces[3].TileId = 3; var sut = new PlayerTurn(lp1, gb); // Act Piece[] pieces = sut.GetAvaiablePieces(diceRollValue); // Assert Assert.Equal(expectedAvaiablePieces, pieces.Length); }