Beispiel #1
0
 @Test
 public void setGizmosTest() {
   List<Bumper> bumpers = new ArrayList<Bumper>();
   Bumper cBump = new CircularBumper(0, 0, 0, "cBump");
   bumpers.add(cBump);
   model.setBumpers(bumpers);
   assertTrue(model.getBumpers().size() == 1);
   assertEquals(model.getBumpers().get(0), cBump);
 }
Beispiel #2
0
 @Test
 public void clearTest() {
   model.addSquareBumper(0, 0, 0, "sBump");
   model.addCircularBumper(0, 20, 0, "cBump");
   model.addTriangularBumper(0, 40, 0, "tBump");
   model.clear();
   assertTrue(model.getBumper("sBump") == null);
   assertTrue(model.getBumper("cBump") == null);
   assertTrue(model.getBumper("tBump") == null);
   assertTrue(model.getBumpers().size() == 0);
 }
Beispiel #3
0
 @Test
 public void addBumpersTest() {
   model.addSquareBumper(0, 0, 0, "sBump");
   model.addCircularBumper(0, 20, 0, "cBump");
   model.addTriangularBumper(0, 40, 0, "tBump");
   assertFalse(model.getBumper("sBump") == null);
   assertTrue(model.getBumper("") == null);
   assertTrue(model.getBumper("sBump") instanceof SquareBumper);
   assertTrue(model.getBumper("cBump") instanceof CircularBumper);
   assertTrue(model.getBumper("tBump") instanceof TriangularBumper);
   model.addSquareBumper(0, 0, 0, "sBump");
   model.addCircularBumper(0, 20, 0, "cBump");
   model.addTriangularBumper(0, 40, 0, "tBump");
   assertTrue(model.getBumpers().size() == 3);
 }