示例#1
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);
 }
示例#2
0
 @Test
 public void rotateElementTest() {
   assertFalse(model.rotateElement(0, 0));
   model.addTriangularBumper(0, 40, 0, "tBump");
   model.addFlipper(0, 0, true, "flipper");
   assertTrue(model.rotateElement(0, 40));
   assertTrue(model.getBumper("tBump").getRotation() == 1);
   assertTrue(model.rotateElement(0, 0));
 }
示例#3
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);
 }