Exemplo n.º 1
0
 /**
  * Test valid <code>Plies</code> when the <code>Piece</code> is not in a <code>Board</code>. There
  * should be no valid <code>Plies</code>.
  */
 public void testPliesNone() {
   // For white Piece
   assertEquals(
       "White Piece fails to produce correct set of Plies",
       new ArrayList<Ply>(),
       whiteKnight.getPlies());
   // For black Piece
   assertEquals(
       "Black Piece fails to produce correct set of Plies",
       new ArrayList<Ply>(),
       blackKnight.getPlies());
 }
Exemplo n.º 2
0
 /**
  * Check that the <code>Plies</code> the <code>Piece</code> would return match the given set of
  * correct <code>Plies</code>.
  */
 private void checkPlies(Set<Ply> correctPlies, Piece piece) {
   Set<Ply> obtainedPlies = new HashSet<Ply>(piece.getPlies());
   assertEquals(
       (piece.isWhite() ? "White" : "Black") + " Piece fails to" + " produce correct set of Plies",
       correctPlies,
       obtainedPlies);
 }