MCPcopy Create free account
hub / github.com/coding-parrot/chess-engine / castleBlockedByCheckBlack

Method castleBlockedByCheckBlack

src/test/java/KingTest.java:276–291  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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() {

Callers

nothing calls this directly

Calls 6

placeKingMethod · 0.95
placeRookMethod · 0.95
placeBishopMethod · 0.95
placePawnMethod · 0.95
getPieceMethod · 0.95
getMoveListMethod · 0.45

Tested by

no test coverage detected