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

Method pawnPromotion

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

Source from the content-addressed store, hash-verified

181 }
182
183 @Test
184 public void pawnPromotion() {
185 Board board = new Board();
186 board.placeKing(4, 0, Color.WHITE);
187 board.placeKing(3, 7, Color.BLACK);
188 board.placePawn(1, 1, Color.BLACK);
189 board.playerToMove = Color.BLACK;
190 System.out.println(board);
191 System.out.println(board.getPiece(1, 1).getMoveList(board));
192 System.out.println(board.getLegalMoves());
193 board.makeMove(Move.get(board.getPiece(1, 1), Cell.get(0, 1), false, null, PieceType.QUEEN));
194 System.out.println(board);
195 System.out.println(board.getLegalMoves());
196 Assert.assertTrue(board.playerPieces.get(Color.BLACK).stream().anyMatch(piece -> piece.sameType(PieceType.QUEEN)));
197 }
198
199 @Test
200 public void pawnPromoteToKnight() {

Callers

nothing calls this directly

Calls 9

placeKingMethod · 0.95
placePawnMethod · 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