コード例 #1
0
 @Test
 public void cardNotAdjacentUpperLeft() {
   Card dodo = CardList.getCard("Dodo");
   DeployedCard middle = new DeployedCard(dodo, 1, 1);
   DeployedCard upperLeft = new DeployedCard(dodo, 0, 0);
   assertFalse(middle.cardAdjacent(upperLeft));
   assertFalse(upperLeft.cardAdjacent(middle));
 }
コード例 #2
0
 @Test
 public void cardAdjacentAbove() {
   Card dodo = CardList.getCard("Dodo");
   DeployedCard middle = new DeployedCard(dodo, 1, 1);
   DeployedCard above = new DeployedCard(dodo, 0, 1);
   assertTrue(middle.cardAdjacent(above));
   assertTrue(above.cardAdjacent(middle));
 }
コード例 #3
0
 @Test
 public void cardAdjacentLeft() {
   Card dodo = CardList.getCard("Dodo");
   DeployedCard middle = new DeployedCard(dodo, 1, 1);
   DeployedCard left = new DeployedCard(dodo, 1, 0);
   assertTrue(middle.cardAdjacent(left));
   assertTrue(left.cardAdjacent(middle));
 }
コード例 #4
0
 @Test
 public void cardNotAdjacentLowerRight() {
   Card dodo = CardList.getCard("Dodo");
   DeployedCard middle = new DeployedCard(dodo, 1, 1);
   DeployedCard lowerRight = new DeployedCard(dodo, 2, 2);
   assertFalse(middle.cardAdjacent(lowerRight));
   assertFalse(lowerRight.cardAdjacent(middle));
 }