public void CountEmptyTest() { CandidateMovesAll allMoves = new CandidateMovesAll(); HexBoard testBoard = new HexBoard(BoardSize); Location[] moves = allMoves.CandidateMoves(testBoard, 0).ToArray(); Assert.AreEqual(BoardCellCount, moves.Length); }
public void CountOneMoveTest() { CandidateMovesAll allMoves = new CandidateMovesAll(); HexBoard testBoard = new HexBoard(BoardSize); testBoard.PlayMove(5, 5, true); IEnumerable <Location> moves = allMoves.CandidateMoves(testBoard, 0); Assert.AreEqual(BoardCellCount - 1, moves.Count()); }
public void CountDownTest() { CandidateMovesAll allMoves = new CandidateMovesAll(); HexBoard testBoard = new HexBoard(BoardSize); int emptyCellCount = BoardSize * BoardSize; for (int x = 0; x < BoardSize; x++) { for (int y = 0; y < BoardSize; y++) { // as cells are played, less empty cells are left testBoard.PlayMove(x, y, true); emptyCellCount--; IEnumerable <Location> moves = allMoves.CandidateMoves(testBoard, 0); Assert.AreEqual(emptyCellCount, moves.Count()); } } }