@Test public void testIsDead() { EnemyInterface e = new Enemy(0, 0, 100); assertEquals("Result", false, e.isDead()); e.kill(); assertEquals("Result", true, e.isDead()); }
/** * Draws the enemies. * * @param g - Graphics */ private void paintEnemies(Graphics g) { for (EnemyInterface e : landscape.getEnemies()) { if (e.isDead()) { g.drawImage(imgEnemieDead, e.getX(), e.getY(), e.getWidth(), e.getHeight(), this); } else { g.drawImage(imgEnemie, e.getX(), e.getY(), e.getWidth(), e.getHeight(), this); } } }
@Test public void testChangeDirection() { EnemyInterface e = new Enemy(0, 0, 100); e.changeDirection(); assertEquals("Result", -1, e.getDirection()); }