コード例 #1
0
 @Test
 public void amoebeShouldHaveCorrectDamagePoints() {
   Amoebe amoebe = AmoebeFactory.get(this.compassProvider, Game.Color.RED);
   assertTrue(amoebe.getDamagePoints() == 0);
   amoebe.addDamagePoint();
   assertTrue(amoebe.getDamagePoints() == 1);
 }
コード例 #2
0
 @Test
 public void amoebeShouldBeSetToASquare() {
   Amoebe amoebe = AmoebeFactory.get(this.compassProvider, Game.Color.RED);
   int[] position = {0, 0};
   Square square = SquareFactory.get(position);
   amoebe.setSquare(square);
   assertTrue(amoebe.getSquare().getPosition()[0] == 0);
   assertTrue(amoebe.getSquare().getPosition()[1] == 0);
 }
コード例 #3
0
 @Test
 public void amoebeShouldExcrement() {
   Amoebe amoebe = AmoebeFactory.get(this.compassProvider, Game.Color.RED);
   int[] position = {0, 0};
   Square square = SquareFactory.get(position);
   amoebe.setSquare(square);
   square.enterSquare(amoebe);
   assertTrue(square.getFoodcubes().size() == 6);
   amoebe.excrement();
   assertTrue(square.getFoodcubes().size() == 8);
 }
コード例 #4
0
 @Test
 public void amoebeShouldDie() {
   Amoebe amoebe = AmoebeFactory.get(this.compassProvider, Game.Color.RED);
   int[] position = {0, 0};
   Square square = SquareFactory.get(position);
   amoebe.setSquare(square);
   square.enterSquare(amoebe);
   assertTrue(square.getAmoebesList().size() == 1);
   amoebe.die();
   assertTrue(square.getAmoebesList().size() == 0);
 }