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

Method pawnPromoteToKnight

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

Source from the content-addressed store, hash-verified

197 }
198
199 @Test
200 public void pawnPromoteToKnight() {
201 Board board = new Board();
202 board.placeKing(4, 0, Color.WHITE);
203 board.placeKing(3, 7, Color.BLACK);
204 board.placePawn(1, 1, Color.BLACK);
205 board.playerToMove = Color.BLACK;
206 System.out.println(board);
207 System.out.println(board.getPiece(1, 1).getMoveList(board));
208 System.out.println(board.getLegalMoves());
209 board.makeMove(Move.get(board.getPiece(1, 1), Cell.get(0, 1), false, null, PieceType.KNIGHT));
210 System.out.println(board);
211 System.out.println(board.getLegalMoves());
212 Assert.assertTrue(board.playerPieces.get(Color.BLACK).stream().anyMatch(piece -> piece.sameType(PieceType.KNIGHT)));
213 }
214
215 @Test
216 public void kingAndQueenOut() {

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