From c304c9aece219973cabe709742b2aa89038c9f75 Mon Sep 17 00:00:00 2001 From: cindyle1 Date: Mon, 11 Sep 2023 14:49:12 +1000 Subject: [PATCH] Added anim JUnit tests for fireworks --- .../factories/ProjectileFactoryTest.java | 25 ++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/source/core/src/test/com/csse3200/game/entities/factories/ProjectileFactoryTest.java b/source/core/src/test/com/csse3200/game/entities/factories/ProjectileFactoryTest.java index b1e4969d1..1065562d4 100644 --- a/source/core/src/test/com/csse3200/game/entities/factories/ProjectileFactoryTest.java +++ b/source/core/src/test/com/csse3200/game/entities/factories/ProjectileFactoryTest.java @@ -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 = { @@ -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"); + } }