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

Method surroundedByEnemy

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

Source from the content-addressed store, hash-verified

146 }
147
148 @Test
149 public void surroundedByEnemy() {
150 Board board = new Board();
151 board.placeKing(3, 3, Color.BLACK);
152 board.placePawn(4, 4, Color.WHITE);
153 board.placePawn(2, 2, Color.WHITE);
154 board.placeRook(4, 2, Color.WHITE);
155 board.placeRook(2, 4, Color.WHITE);
156 board.placePawn(4, 3, Color.WHITE);
157 board.placePawn(3, 4, Color.WHITE);
158 board.placeRook(2, 3, Color.WHITE);
159 board.placeRook(3, 2, Color.WHITE);
160 board.placeKing(7, 7, Color.WHITE);
161 System.out.println(board);
162 System.out.println(board.getPiece(3, 3).getMoveList(board));
163 Assert.assertEquals(1, board.getPiece(3, 3).getMoveList(board).size());
164 Assert.assertTrue(board.getPiece(3, 3).getMoveList(board).stream().allMatch(c -> c.captureMove));
165 }
166
167 @Test
168 public void canCastleLeft() {

Callers

nothing calls this directly

Calls 5

placeKingMethod · 0.95
placePawnMethod · 0.95
placeRookMethod · 0.95
getPieceMethod · 0.95
getMoveListMethod · 0.45

Tested by

no test coverage detected