()
| 163 | } |
| 164 | |
| 165 | @Test |
| 166 | public void doubleCheck() { |
| 167 | Board board = new Board(); |
| 168 | board.placeKing(4, 0, Color.WHITE); |
| 169 | board.placeRook(3, 1, Color.WHITE); |
| 170 | board.placeKing(3, 7, Color.BLACK); |
| 171 | board.placeRook(1, 0, Color.BLACK); |
| 172 | board.placeKnight(2, 0, Color.BLACK); |
| 173 | System.out.println(board); |
| 174 | System.out.println(board.getPiece(4, 0).getMoveList(board)); |
| 175 | System.out.println(board.getLegalMoves()); |
| 176 | board.playerToMove = Color.BLACK; |
| 177 | board.makeMove(Move.get(board.getPiece(2, 0), Cell.get(3, 2), false)); |
| 178 | System.out.println(board); |
| 179 | System.out.println(board.getLegalMoves()); |
| 180 | Assert.assertTrue(board.getLegalMoves().stream().allMatch(move -> move.piece.sameType(PieceType.KING))); |
| 181 | } |
| 182 | |
| 183 | @Test |
| 184 | public void pawnPromotion() { |
nothing calls this directly
no test coverage detected