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

Method doubleCheck

src/test/java/BoardTest.java:165–181  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

163 }
164
165 @Test
166 public void doubleCheck() {
167 Board board = new Board();
168 board.placeKing(4, 0, Color.WHITE);
169 board.placeRook(3, 1, Color.WHITE);
170 board.placeKing(3, 7, Color.BLACK);
171 board.placeRook(1, 0, Color.BLACK);
172 board.placeKnight(2, 0, Color.BLACK);
173 System.out.println(board);
174 System.out.println(board.getPiece(4, 0).getMoveList(board));
175 System.out.println(board.getLegalMoves());
176 board.playerToMove = Color.BLACK;
177 board.makeMove(Move.get(board.getPiece(2, 0), Cell.get(3, 2), false));
178 System.out.println(board);
179 System.out.println(board.getLegalMoves());
180 Assert.assertTrue(board.getLegalMoves().stream().allMatch(move -> move.piece.sameType(PieceType.KING)));
181 }
182
183 @Test
184 public void pawnPromotion() {

Callers

nothing calls this directly

Calls 10

placeKingMethod · 0.95
placeRookMethod · 0.95
placeKnightMethod · 0.95
getPieceMethod · 0.95
getLegalMovesMethod · 0.95
makeMoveMethod · 0.95
getMethod · 0.95
getMethod · 0.95
sameTypeMethod · 0.80
getMoveListMethod · 0.45

Tested by

no test coverage detected