-
Notifications
You must be signed in to change notification settings - Fork 9
GameState Testing Plan
The Game State is a key component of the game's functionality being in charge of the storing and saving of shared, global game data. As such it is vital that it is tested thoroughly to ensure it behaves exactly as expected.
The objective is to validate the behaviour of the game state by ensuring:
- The update and storage data of is accurate.
- When data is attempted to be retrieved it is the most recent version.
- That state change listeners can be registered and work correctly.
- A new
GameState
is created with no data.
Objective: To ensure that data is correctly added and retrieved from the state.
Steps:
- Data is added into the
GameState
in a key-value pair. - Data is then retrieved using the selected key.
- Validation of original inputted data and retrieved data is identical.
Objective: Verify that a listener gets notified of a state change.
Steps:
- Register a listener for a state change.
- Add data to the game state to trigger a state change.
- Verify that the state listener was notified that a state change occurred.
- Verify that the listener has the updated state data.
Objective: To verify that multiple state listeners can be registered and work correctly.
Steps:
- Register two state change listeners
- Update the
GameState
to trigger the notification - Verify that the first listener gets notified and access to the updated data.
- Verify that the second listener gets notified and access to the updated data.
Objective: To ensure that when a state listener unregisters from the state change notifications it no longer gets notified.
Steps:
- Register a state change listener
- Unregister the state change listener
- Update the
GameState
to trigger a notification - Validate that the listener did not receive a notification.
Escape Earth Game
Interaction Controller and Interactable Components
Game and Entity Configuration Files
Loading Game Configuration Files