-
Notifications
You must be signed in to change notification settings - Fork 9
CombatStatsComponent Test Plan
The CombatStatsComponent
manages the combat statistics of an entity in the game, such as health, damage, and lives. Given its critical role in combat between the player and enemies, it is required to ensure this component satisfies the following test plan.
The following tests were created with a generic entity in mind to ensure the tests are easily extendable for future use.
To validate the behaviour and integrity of combat statistics managed by the CombatStatsComponent
, ensuring:
- The correct initialization, retrieval, and setting of combat stats.
- Proper combat interactions between entities (like hitting).
- Accurate event triggering related to combat stats.
- Register the EntityService in ServiceLocator.
- Create an instance of an Entity with the
CombatStatsComponent
. - Mock necessary components like
EventHandler
.
Objective: To verify setting and retrieving health values.
Steps:
- Validate the initial health value.
- Change health and validate the new value.
- Test edge cases (health below zero).
Objective: To check the entity's dead status.
Steps:
- Validate the initial entity's life state.
- Reduce health to zero and verify death status.
- Simulate an attack from another entity and validate death status.
Objective: To validate adding or subtracting health.
Steps:
- Add health and validate the new value.
- Subtract health and validate the new value.
- Test adding health multiple times.
Objective: To validate setting and retrieving base attack values.
Steps:
- Validate the initial attack value.
- Set and retrieve new attack values.
- Test edge cases (negative attack values).
Objective: To validate setting and retrieving attack multiplier values.
Steps:
- Validate the initial multiplier value.
- Change and retrieve the new multiplier value.
- Test edge cases (negative or zero multipliers).
Objective: To verify setting and retrieving immunity status.
Steps:
- Validate the initial immunity status.
- Change and validate the new immunity status.
Objective: To validate changing the immunity status.
Steps:
- Validate the initial immunity status.
- Change immunity status and validate the new status.
Objective: To validate setting and retrieving the number of lives.
Steps:
- Validate the initial number of lives.
- Change and retrieve the number of lives.
- Test edge cases (negative lives or lives set to zero).
Objective: To validate reducing the number of lives.
Steps:
- Set a specified number of lives.
- Reduce lives and validate the new value.
- Test edge cases (reducing lives from zero).
Objective: To validate adding lives.
Steps:
- Set a specific number of lives.
- Add lives and validate the new value.
- Test edge cases (adding more than the maximum allowed lives).
Objective: To validate the triggering of health update events.
Steps:
- Modify the health of the entity.
- Verify that the "updateHealth" event is triggered.
Objective: To validate the triggering of lives update events.
Steps:
- Modify the number of lives of the entity.
- Verify that the "updateLives" event is triggered.
Objective: To validate the triggering of a max lives event.
Steps:
- Set the lives of the entity to the maximum.
- Try adding another life.
- Verify that the "maxLivesAlert" event is triggered.
Escape Earth Game
Interaction Controller and Interactable Components
Game and Entity Configuration Files
Loading Game Configuration Files