Esempio n. 1
0
 /**
  * Tests the swap method by swapping two gems and checking if their position has changed. Also, it
  * checks whether the gems are not changed if they are not next to each other.
  */
 @Test
 public final void testSwap() {
   board = new Board(2, 0, 0, false);
   assertFalse(board.swap(0, 1, 1, 0));
   gems = board.getGems();
   Gem gem1 = gems[0][0];
   Gem gem2 = gems[0][1];
   assertTrue(board.swap(0, 0, 0, 1));
   assertEquals(gems[0][0], gem2);
   assertEquals(gems[0][1], gem1);
   assertTrue(board.swap(0, 0, 1, 0));
 }