Skip to content

Commit

Permalink
Added anim JUnit tests for fireworks
Browse files Browse the repository at this point in the history
  • Loading branch information
cindyle1 committed Sep 11, 2023
1 parent 5422da3 commit c304c9a
Showing 1 changed file with 24 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ class ProjectileFactoryTest {
"images/projectiles/engineer_projectile.atlas",
"images/projectiles/stun_effect.atlas",
"images/projectiles/burn_effect.atlas",
"images/projectiles/snow_ball.atlas"
"images/projectiles/snow_ball.atlas",
"images/projectiles/firework_anim.atlas"
};

private final String[] animations = {
Expand Down Expand Up @@ -272,5 +273,27 @@ public void testSlowProjectileAnimationController() {
assertNotNull(slowProjectile.getComponent(SnowBallProjectileAnimationController.class),
"Slow Projectile does not have Animation Controller");
}

@Test
public void testFireworkProjectileCreation() {
Entity fireworkProjectile = ProjectileFactory.createFireworks(
PhysicsLayer.TOWER, new Vector2(0.1f, 0.1f), new Vector2(1f, 1f));
assertNotNull(fireworkProjectile, "fireworkProjectile is null");
}

@Test
public void testFireworkProjectileAnimationRenderComponent() {
Entity fireworkProjectile = ProjectileFactory.createFireworks(
PhysicsLayer.TOWER, new Vector2(0.1f, 0.1f), new Vector2(1f, 1f));
assertNotNull(fireworkProjectile.getComponent(AnimationRenderComponent.class),
"Slow Projectile does not have AnimationRenderComponent");
}
@Test
public void testFireworkProjectileAnimationController() {
Entity fireworkProjectile = ProjectileFactory.createFireworks(
PhysicsLayer.TOWER, new Vector2(0.1f, 0.1f), new Vector2(1f, 1f));
assertNotNull(fireworkProjectile.getComponent(FireworkAnimationController.class),
"Slow Projectile does not have Animation Controller");
}
}

0 comments on commit c304c9a

Please sign in to comment.