Test Plan for End day display Component - UQcsse3200/2024-studio-3 GitHub Wiki
Test Environment
- Framework: JUnit 4
- Tools: LibGDX framework's testing utilities, possibly incorporating a mocking framework such as Mockito.
Test Cases
Unit Tests
- Initialization Test: Purpose: Verify that the EndDayDisplay is properly initialized with all its components. Expected Results: All properties like layout, goldLabel, birdImage, and pointImages should be properly initialized and non-null.
- UI Element Loading Test: Purpose: Ensure all images and UI elements like coin images and customer lists are loaded and set up correctly. Expected Results: Image resources should be successfully loaded from ServiceLocator.getResourceService(), and UI components should be correctly added to the stage.
- Event Listener Addition Test: Purpose: Check that all necessary event listeners are added correctly. Expected Results: All events, such as gold updates (goldUpdated) and customer feedback updates (customerSpawned), should have corresponding listeners properly set.
- Show and Hide Functionality Test: Purpose: Test the functionality of the show() and hide() methods. Expected Results: After calling show(), the interface should be visible; after calling hide(), the interface should be hidden.
- Gold Display Animation Test: Purpose: Verify that the animation for updating the gold amount is smooth and correct. Expected Results: Changes in the gold amount should trigger an animation, correctly displaying the final gold count.
- Customer List Update Test: Purpose: Ensure that the customer list updates in real-time according to game events. Expected Results: After adding a new customer name, the list should immediately update to display it.
Integration Tests
- User Interaction Test: Purpose: Simulate user interactions to verify responses to actions like clicking the close button. Expected Results: Clicking the close button should invoke the toggleVisibility() method, and the interface should correspondingly show or hide.
- Game Event Integration Test: Purpose: Test the EndDayDisplay's response to game events in a running game environment. Expected Results: Game events like the end of a day should trigger the display, and all relevant data such as gold and customer feedback should be displayed correctly.
Test Execution Plan
Frequency of Execution: Perform after each major iteration or feature update. Responsible Personnel: Designate team members to execute tests and record results. Documentation and Reporting: Results should be meticulously recorded, and the issue tracking system should be updated upon identifying any issues.