Skip to content

Commit

Permalink
refactor: Cleaned up MobBossFactoryTest code.
Browse files Browse the repository at this point in the history
  • Loading branch information
JSLLW committed Sep 30, 2023
1 parent 6a4fbae commit 96b9e71
Showing 1 changed file with 19 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,33 +127,10 @@ public void setUp() {
iceBaby = MobBossFactory.createIceBoss();
}

@Test
public void testDemonBoss() {
assertNotNull(demon, "Demon Boss should not be null.");
assertNotNull(demon.getComponent(PhysicsComponent.class),
"Demon Boss does not have physics component.");
assertNotNull(demon.getComponent(ColliderComponent.class),
"Demon Boss does not have collider component.");
assertNotNull(demon.getComponent(PhysicsMovementComponent.class),
"Demon Boss does not have physics movement component.");
assertNotNull(demon.getComponent(HitboxComponent.class),
"Demon Boss does not have hitbox component.");
assertNotNull(demon.getComponent(TouchAttackComponent.class),
"Base Boss does not have touch attack component.");
assertEquals(5000, demon.getComponent(CombatStatsComponent.class).getHealth(),
"Demon Boss health should be 5000.");
assertEquals(0, demon.getComponent(CombatStatsComponent.class).getBaseAttack(),
"Demon Boss base attack should be 0.");
assertNotNull(demon.getComponent(AnimationRenderComponent.class),
"Demon Boss does not have an animation render component.");
assertNotNull(demon.getComponent(DemonAnimationController.class),
"Demon Boss does not have an animation controller.");
}

@Test
public void testCreateMobBossNotNull() {
assertNotNull(baseBoss, "Base Boss should not be null.");
// assertNotNull(demon, "Demon Boss should not be null.");
assertNotNull(demon, "Demon Boss should not be null.");
assertNotNull(slimeyBoy, "Slimey Boy should not be null.");
assertNotNull(patrick, "Patrick Boss should not be null.");
assertNotNull(deadPatrick, "Dead Patrick Boss should not be null.");
Expand All @@ -164,8 +141,8 @@ public void testCreateMobBossNotNull() {
public void testMobBossPhysicsComponent() {
assertNotNull(baseBoss.getComponent(PhysicsComponent.class),
"Base Boss does not have physics component.");
// assertNotNull(demon.getComponent(PhysicsComponent.class),
// "Demon Boss does not have physics component.");
assertNotNull(demon.getComponent(PhysicsComponent.class),
"Demon Boss does not have physics component.");
assertNotNull(slimeyBoy.getComponent(PhysicsComponent.class),
"Slimey Boy does not have physics component.");
assertNotNull(patrick.getComponent(PhysicsComponent.class),
Expand All @@ -180,8 +157,8 @@ public void testMobBossPhysicsComponent() {
public void testMobBossColliderComponent() {
assertNotNull(baseBoss.getComponent(ColliderComponent.class),
"Base Boss does not have collider component.");
// assertNotNull(demon.getComponent(ColliderComponent.class),
// "Demon Boss does not have collider component.");
assertNotNull(demon.getComponent(ColliderComponent.class),
"Demon Boss does not have collider component.");
assertNotNull(slimeyBoy.getComponent(ColliderComponent.class),
"Slimey Boy does not have collider component.");
assertNotNull(patrick.getComponent(ColliderComponent.class),
Expand All @@ -196,8 +173,8 @@ public void testMobBossColliderComponent() {
public void testMobBossPhysicsMovementComponent() {
assertNotNull(baseBoss.getComponent(PhysicsMovementComponent.class),
"Base Boss does not have physics movement component.");
// assertNotNull(demon.getComponent(PhysicsMovementComponent.class),
// "Demon Boss does not have physics movement component.");
assertNotNull(demon.getComponent(PhysicsMovementComponent.class),
"Demon Boss does not have physics movement component.");
assertNotNull(slimeyBoy.getComponent(PhysicsMovementComponent.class),
"Slimey Boy does not have physics movement component.");
assertNotNull(patrick.getComponent(PhysicsMovementComponent.class),
Expand All @@ -212,8 +189,8 @@ public void testMobBossPhysicsMovementComponent() {
public void testMobBossHitboxComponent() {
assertNotNull(baseBoss.getComponent(HitboxComponent.class),
"Base Boss does not have hitbox component.");
// assertNotNull(demon.getComponent(HitboxComponent.class),
// "Demon Boss does not have hitbox component.");
assertNotNull(demon.getComponent(HitboxComponent.class),
"Demon Boss does not have hitbox component.");
assertNotNull(slimeyBoy.getComponent(HitboxComponent.class),
"Slimey Boy does not have hitbox component.");
assertNotNull(patrick.getComponent(HitboxComponent.class),
Expand All @@ -227,8 +204,8 @@ public void testMobBossHitboxComponent() {
public void testMobBossTouchAttackComponent() {
assertNotNull(baseBoss.getComponent(TouchAttackComponent.class),
"Base Boss does not have touch attack component.");
// assertNotNull(demon.getComponent(TouchAttackComponent.class),
// "Base Boss does not have touch attack component.");
assertNotNull(demon.getComponent(TouchAttackComponent.class),
"Base Boss does not have touch attack component.");
assertNotNull(slimeyBoy.getComponent(TouchAttackComponent.class),
"Slimey Boy does not have touch attack component.");
assertNotNull(patrick.getComponent(TouchAttackComponent.class),
Expand All @@ -241,10 +218,10 @@ public void testMobBossTouchAttackComponent() {

@Test
public void testMobBossCombatStats(){
// assertEquals(5000, demon.getComponent(CombatStatsComponent.class).getHealth(),
// "Demon Boss health should be 5000.");
// assertEquals(0, demon.getComponent(CombatStatsComponent.class).getBaseAttack(),
// "Demon Boss base attack should be 0.");
assertEquals(5000, demon.getComponent(CombatStatsComponent.class).getHealth(),
"Demon Boss health should be 5000.");
assertEquals(0, demon.getComponent(CombatStatsComponent.class).getBaseAttack(),
"Demon Boss base attack should be 0.");
assertEquals(500, slimeyBoy.getComponent(CombatStatsComponent.class).getHealth(),
"Slimey Boy health should be 500.");
assertEquals(0, slimeyBoy.getComponent(CombatStatsComponent.class).getBaseAttack(),
Expand All @@ -265,8 +242,8 @@ public void testMobBossCombatStats(){

@Test
public void testMobBossAnimationRenderComponent() {
// assertNotNull(demon.getComponent(AnimationRenderComponent.class),
// "Demon Boss does not have an animation render component.");
assertNotNull(demon.getComponent(AnimationRenderComponent.class),
"Demon Boss does not have an animation render component.");
assertNotNull(slimeyBoy.getComponent(AnimationRenderComponent.class),
"Slimey Boy does not have an animation render component.");
assertNotNull(patrick.getComponent(AnimationRenderComponent.class),
Expand All @@ -279,8 +256,8 @@ public void testMobBossAnimationRenderComponent() {

@Test
public void testMobBossAnimationController() {
// assertNotNull(demon.getComponent(DemonAnimationController.class),
// "Demon Boss does not have an animation controller.");
assertNotNull(demon.getComponent(DemonAnimationController.class),
"Demon Boss does not have an animation controller.");
assertNotNull(slimeyBoy.getComponent(DemonAnimationController.class),
"Slimey Boy does not have an animation controller.");
assertNotNull(patrick.getComponent(PatrickAnimationController.class),
Expand Down

0 comments on commit 96b9e71

Please sign in to comment.