Skip to content

Main Character Statistics Test Plan

PRATUL WADHWA edited this page Aug 29, 2024 · 3 revisions

Brief

The overall goal of this test is to ensure that the create() method correctly sets up the necessary components and event listeners for the player's stats in the game.

Unit Testing

  • Initialisation Check: The test begins by indicating the start of the create() method test.

  • Actor Addition Validation: It checks if character stats have been successfully added, controlled by the addActorsTester boolean flag. If true, the test proceeds to validate event listener registration; otherwise, it reports a failure in adding stats.

  • Event Listener Verification: It verifies whether the appropriate event listeners (updateHealth, updateExperience, and updateHunger) have been registered with the entity. For each event, a success or failure message is printed based on the listener's presence.

  • Final Implementation: it calls the required functions to animate all stats bars to decrease from their max Value to 0.

Visual (Video) Testing

  • Initialisation Check: The test begins by checking if the player statistics bars appear on the screen

  • Event Listener Verification: Verify event listener functions correctly by checking that the health, experience and hunger bars are all able to decrease. This was completed using health values only as there is no methods specified on how hunger and experience are incremented or decremented.

Clone this wiki locally