-
Notifications
You must be signed in to change notification settings - Fork 4
TNTDamageComponent Test Plan
Mohamad Dabboussi edited this page Sep 10, 2023
·
1 revision
Splash damage and knock-back effects are important elements in creating a dynamic and interactive gaming experience. To ensure the correct and consistent behavior of such mechanics, the TNTDamageComponent
is rigorously tested according to the following test plan.
The objective is to validate the correct application of splash damage and knock-back effects by TNTDamageComponent
, ensuring:
- Target entities within range receive the expected amount of damage.
- Target entities outside the range are not affected.
- Entities with different target layers are not affected even if they are within the splash range.
- Initialize necessary services and resources for testing using
ServiceLocator
. - Register
EntityService
andPhysicsService
withServiceLocator
. - Load textures for the TNT Tower using a new
ResourceService
instance.
Objective: To verify the correct application of damage to targets that are within the splash radius.
Steps:
- Position the Attacker and a Target within the same lane and inside the splash radius.
- Trigger the "TNTDamageStart" event for the Attacker entity.
- Verify that the target's health is reduced by the expected amount.
Objective: To verify that targets outside the splash radius are not affected.
Steps:
- Position the Attacker and two Targets in such a way that one is outside the splash radius and the other is outside the lane but inside the radius.
- Trigger the "TNTDamageStart" event for the Attacker entity.
- Verify that neither target's health is affected.
Objective: To verify that entities with different target layers are not affected.
Steps:
- Position the Attacker and a non-target entity (Entity_3) within the splash radius but assign them different target layers.
- Trigger the "TNTDamageStart" event for the Attacker entity.
- Verify that the non-target entity's health is not affected.
- The
ServiceLocator
class functions as expected and has been previously tested. - The
CombatStatsComponent
,PhysicsComponent
, andHitboxComponent
classes have methods and behavior that are correctly implemented. - External extensions such as MockitoExtension and GameExtension function as expected.