Example #1
0
 @Test
 public void setAbsorberTest() {
   Absorber absorb = new Absorber("absorb", 0, 0, 60, 60);
   model.setAbsorber(absorb);
   assertTrue(model.getAbsorber() != null);
   assertEquals(model.getAbsorber(), absorb);
 }
Example #2
0
 @Test
 public void addAbsorberTest() {
   assertTrue(model.getAbsorber() == null);
   model.addAbsorber("absorb", 0, 0, 20, 20);
   model.addAbsorber("absorb", 0, 20, 60, 80);
   assertFalse(model.getAbsorber() == null);
   assertTrue(model.getAbsorber().getXTopLeft() == 0);
   assertTrue(model.getAbsorber().getYTopLeft() == 20);
   assertTrue(model.getAbsorber().getXBottomRight() == 60);
   assertTrue(model.getAbsorber().getYBottomRight() == 80);
 }