MCPcopy Index your code
hub / github.com/coding-parrot/chess-engine / castleBlockedByCheck

Method castleBlockedByCheck

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

Source from the content-addressed store, hash-verified

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

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