private GameBoard_Accessor CreateTestBoard() { GameBoard_Accessor gameboard = new GameBoard_Accessor(); for (int i = 0; i < 8; i++) for (int j = 0; j < 8; j++) gameboard.GameBoardSpaces[i, j] = null; gameboard.GameBoardSpaces[1, 1] = new DraughtPiece(PlayerColours.White, 1, 1); gameboard.GameBoardSpaces[3, 1] = new DraughtPiece(PlayerColours.White, 3, 1); gameboard.GameBoardSpaces[0, 2] = new DraughtPiece(PlayerColours.Black, 0, 2); gameboard.GameBoardSpaces[0, 2].IsKing = true; gameboard.GameBoardSpaces[4, 2] = new DraughtPiece(PlayerColours.Black, 4, 2); gameboard.GameBoardSpaces[1, 3] = new DraughtPiece(PlayerColours.White, 1, 3); gameboard.GameBoardSpaces[3, 3] = new DraughtPiece(PlayerColours.White, 3, 3); gameboard.GameBoardSpaces[4, 6] = new DraughtPiece(PlayerColours.Black, 4, 6); gameboard.GameBoardSpaces[7, 3] = new DraughtPiece(PlayerColours.White, 7, 3); gameboard.GameBoardSpaces[7, 3].IsKing = true; gameboard.GameBoardSpaces[0, 4] = new DraughtPiece(PlayerColours.Black, 0, 4); gameboard.GameBoardSpaces[0, 4].IsKing = true; gameboard.GameBoardSpaces[4, 4] = new DraughtPiece(PlayerColours.Black, 4, 4); gameboard.GameBoardSpaces[7, 5] = new DraughtPiece(PlayerColours.White, 7, 5); gameboard.GameBoardSpaces[7, 5].IsKing = true; gameboard.GameBoardSpaces[2, 6] = new DraughtPiece(PlayerColours.Black, 2, 6); gameboard.GameBoardSpaces[2, 6].IsKing = true; return gameboard; }
private GameBoard_Accessor CreateWhitePlayerHasWonBoard() { GameBoard_Accessor gameboard = new GameBoard_Accessor(); for (int i = 0; i < 8; i++) for (int j = 0; j < 8; j++) gameboard.GameBoardSpaces[i, j] = null; gameboard.GameBoardSpaces[0, 0] = new DraughtPiece(PlayerColours.White, 0, 0); return gameboard; }
public void SetTheGameBoardTest() { GameBoard_Accessor target = new GameBoard_Accessor(); string expected = "\nw_w_w_w_\n_w_w_w_w\nw_w_w_w_\n________\n________\n_b_b_b_b\nb_b_b_b_\n_b_b_b_b"; target.SetTheGameBoard(); string actual = target.ToString(); Assert.AreEqual(expected, actual); }