|
|
@ -208,4 +208,21 @@ class ChessBoardTest { |
|
|
|
|
|
|
|
assertArrayEquals(resultBoard, chessBoard.getBoard()); |
|
|
|
} |
|
|
|
|
|
|
|
@Test |
|
|
|
void scanForOccurringFigure() { |
|
|
|
assertEquals(8, chessBoard.scanForOccurringFigure(ChessFigure.Type.PAWN, ChessFigure.Team.WHITE)); |
|
|
|
assertEquals(2, chessBoard.scanForOccurringFigure(ChessFigure.Type.CASTLE, ChessFigure.Team.WHITE)); |
|
|
|
assertEquals(2, chessBoard.scanForOccurringFigure(ChessFigure.Type.BISHOP, ChessFigure.Team.WHITE)); |
|
|
|
assertEquals(2, chessBoard.scanForOccurringFigure(ChessFigure.Type.KNIGHT, ChessFigure.Team.WHITE)); |
|
|
|
assertEquals(1, chessBoard.scanForOccurringFigure(ChessFigure.Type.QUEEN, ChessFigure.Team.WHITE)); |
|
|
|
assertEquals(1, chessBoard.scanForOccurringFigure(ChessFigure.Type.KING, ChessFigure.Team.WHITE)); |
|
|
|
|
|
|
|
assertEquals(8, chessBoard.scanForOccurringFigure(ChessFigure.Type.PAWN, ChessFigure.Team.BLACK)); |
|
|
|
assertEquals(2, chessBoard.scanForOccurringFigure(ChessFigure.Type.CASTLE, ChessFigure.Team.BLACK)); |
|
|
|
assertEquals(2, chessBoard.scanForOccurringFigure(ChessFigure.Type.BISHOP, ChessFigure.Team.BLACK)); |
|
|
|
assertEquals(2, chessBoard.scanForOccurringFigure(ChessFigure.Type.KNIGHT, ChessFigure.Team.BLACK)); |
|
|
|
assertEquals(1, chessBoard.scanForOccurringFigure(ChessFigure.Type.QUEEN, ChessFigure.Team.BLACK)); |
|
|
|
assertEquals(1, chessBoard.scanForOccurringFigure(ChessFigure.Type.KING, ChessFigure.Team.BLACK)); |
|
|
|
} |
|
|
|
} |