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

Method surroundedByEnemy

src/test/java/QueenTest.java:115–131  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

113 }
114
115 @Test
116 public void surroundedByEnemy() {
117 Board board = new Board();
118 board.placeQueen(3, 3, Color.BLACK);
119 board.placePawn(4, 4, Color.WHITE);
120 board.placePawn(2, 2, Color.WHITE);
121 board.placeRook(4, 2, Color.WHITE);
122 board.placeRook(2, 4, Color.WHITE);
123 board.placePawn(4, 3, Color.WHITE);
124 board.placePawn(3, 4, Color.WHITE);
125 board.placeRook(2, 3, Color.WHITE);
126 board.placeRook(3, 2, Color.WHITE);
127 System.out.println(board);
128 System.out.println(board.getPiece(3, 3).getMoveList(board));
129 Assert.assertEquals(8, board.getPiece(3, 3).getMoveList(board).size());
130 Assert.assertTrue(board.getPiece(3, 3).getMoveList(board).stream().allMatch(c -> c.captureMove));
131 }
132}

Callers

nothing calls this directly

Calls 5

placeQueenMethod · 0.95
placePawnMethod · 0.95
placeRookMethod · 0.95
getPieceMethod · 0.95
getMoveListMethod · 0.45

Tested by

no test coverage detected