()
| 274 | } |
| 275 | |
| 276 | @Test |
| 277 | public void castleBlockedByCheckBlack() { |
| 278 | Board board = new Board(); |
| 279 | board.placeKing(0, 4, Color.WHITE); |
| 280 | board.placeKing(7, 4, Color.BLACK); |
| 281 | board.placeRook(7, 7, Color.BLACK); |
| 282 | board.placeRook(7, 0, Color.BLACK); |
| 283 | board.placeBishop(7, 2, Color.BLACK); |
| 284 | board.placePawn(6, 6, Color.BLACK); |
| 285 | board.placePawn(6, 7, Color.BLACK); |
| 286 | board.placeRook(4, 5, Color.WHITE); |
| 287 | System.out.println(board); |
| 288 | System.out.println(board.getPiece(7, 4).getMoveList(board)); |
| 289 | Assert.assertEquals(3, board.getPiece(7, 4).getMoveList(board).size()); |
| 290 | Assert.assertTrue(board.getPiece(7, 4).getMoveList(board).stream().noneMatch(c -> Math.abs(c.piece.position.col - c.target.col) == 2)); |
| 291 | } |
| 292 | |
| 293 | @Test |
| 294 | public void castleNotBlockedByCheckBlack() { |
nothing calls this directly
no test coverage detected