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

Method castleBlockedLeftSide

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

Source from the content-addressed store, hash-verified

214 }
215
216 @Test
217 public void castleBlockedLeftSide() {
218 Board board = new Board();
219 board.placeKing(0, 4, Color.WHITE);
220 board.placeKing(7, 4, Color.BLACK);
221 board.placeRook(0, 7, Color.WHITE);
222 board.placeRook(0, 0, Color.WHITE);
223 board.placeBishop(0, 2, Color.WHITE);
224 board.placePawn(1, 6, Color.WHITE);
225 board.placePawn(1, 7, Color.WHITE);
226 System.out.println(board);
227 System.out.println(board.getPiece(0, 4).getMoveList(board));
228 Assert.assertEquals(6, board.getPiece(0, 4).getMoveList(board).size());
229 Assert.assertTrue(board.getPiece(0, 4).getMoveList(board).stream().noneMatch(c -> c.captureMove));
230 board.makeMove(board.getPiece(0, 4).getMoveList(board).stream().filter(c -> Math.abs(c.piece.position.col - c.target.col) == 2).findAny().get());
231 System.out.println(board);
232 System.out.println(board.getPiece(0, 6).getMoveList(board));
233 Assert.assertEquals(2, board.getPiece(0, 6).getMoveList(board).size());
234 Assert.assertEquals(9, board.getPiece(0, 5).getMoveList(board).size());
235 }
236
237 @Test
238 public void castleBlockedByCheck() {

Callers

nothing calls this directly

Calls 8

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

Tested by

no test coverage detected