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

Method kingAndQueenOut

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

Source from the content-addressed store, hash-verified

213 }
214
215 @Test
216 public void kingAndQueenOut() {
217 Board board = Board.getStartBoard();
218 board = board.copy();
219 board.makeMove(board.getLegalMoves()
220 .stream()
221 .filter(c -> c.piece.sameType(PieceType.PAWN))
222 .filter(c -> c.piece.position.equals(Cell.get(1, 3)))
223 .filter(c -> c.target.equals(Cell.get(2, 3)))
224 .findAny()
225 .get());
226 board = board.copy();
227 board.makeMove(board.getLegalMoves()
228 .stream()
229 .filter(c -> c.piece.sameType(PieceType.PAWN))
230 .filter(c -> c.piece.position.equals(Cell.get(6, 4)))
231 .filter(c -> c.target.equals(Cell.get(5, 4)))
232 .findAny()
233 .get());
234 board = board.copy();
235 board.makeMove(board.getLegalMoves()
236 .stream()
237 .filter(c -> c.piece.sameType(PieceType.KING))
238 .filter(c -> c.piece.position.equals(Cell.get(0, 4)))
239 .filter(c -> c.target.equals(Cell.get(1, 3)))
240 .findAny()
241 .get());
242 board = board.copy();
243 board.makeMove(board.getLegalMoves()
244 .stream()
245 .filter(c -> c.piece.sameType(PieceType.QUEEN))
246 .filter(c -> c.piece.position.equals(Cell.get(7, 3)))
247 .filter(c -> c.target.equals(Cell.get(6, 4)))
248 .findAny()
249 .get());
250 System.out.println(board);
251 System.out.println(board.getLegalMoves());
252 Assert.assertEquals(23, board.getLegalMoves().size());
253 }
254
255 @Test
256 public void kingAndKnightOut() {

Callers

nothing calls this directly

Calls 8

getStartBoardMethod · 0.95
copyMethod · 0.95
makeMoveMethod · 0.95
getLegalMovesMethod · 0.95
getMethod · 0.95
sameTypeMethod · 0.80
getMethod · 0.45
equalsMethod · 0.45

Tested by

no test coverage detected