コード例 #1
0
  @Test
  public void dropBombTest() {
    // character should drop bomb
    Character c = new Character();
    c.dropBomb();

    List<Bomb> bombs = BombSystem.getInstance().getBombs();
    assertFalse(bombs.isEmpty());
  }
コード例 #2
0
  @Test
  public void dropBombAtSamePlaceTest() {
    // character should drop bomb into their own place
    Character c = new Character();
    c.setX(3.0d);
    c.setY(3.0d);

    c.dropBomb();
    List<Bomb> bombs = BombSystem.getInstance().getBombs();
    Bomb bomb = bombs.get(0);
    assertTrue(bomb.getX() == 3.0d);
  }
コード例 #3
0
 @Before
 public void setUp() throws Exception {
   BombSystem.createInstance();
 }