()
| 235 | } |
| 236 | |
| 237 | @Test |
| 238 | public void castleBlockedByCheck() { |
| 239 | Board board = new Board(); |
| 240 | board.placeKing(0, 4, Color.WHITE); |
| 241 | board.placeKing(7, 4, Color.BLACK); |
| 242 | board.placeRook(0, 7, Color.WHITE); |
| 243 | board.placeRook(0, 0, Color.WHITE); |
| 244 | board.placeBishop(0, 2, Color.WHITE); |
| 245 | board.placePawn(1, 6, Color.WHITE); |
| 246 | board.placePawn(1, 7, Color.WHITE); |
| 247 | board.placeRook(5, 5, Color.BLACK); |
| 248 | System.out.println(board); |
| 249 | System.out.println(board.getPiece(0, 4).getMoveList(board)); |
| 250 | Assert.assertEquals(3, board.getPiece(0, 4).getMoveList(board).size()); |
| 251 | Assert.assertTrue(board.getPiece(0, 4).getMoveList(board).stream().noneMatch(c -> Math.abs(c.piece.position.col - c.target.col) == 2)); |
| 252 | } |
| 253 | |
| 254 | @Test |
| 255 | public void castleNotBlockedByCheck() { |
nothing calls this directly
no test coverage detected