Test Plan for Controls Screen - UQcsse3200/2023-studio-2 GitHub Wiki
Overview
This test plan covers unit testing for the ControlsScreen
class in the game. The purpose of these tests is to ensure that the ControlsScreen
class behaves as expected, especially in terms of asset loading and screen rendering.
Test Environment
The tests will be conducted in a headless environment using a mock application instance.
Test Objectives
- Verify that asset loading in
ControlsScreen
works correctly. - Confirm that rendering and resizing methods in
ControlsScreen
function as expected. - Ensure that specific assets are loaded as intended.
Test Cases
testControlsScreenAssetLoading
Test Case 1: Objective: Verify that asset loading in ControlsScreen
is functioning correctly.
Test Steps:
- Create an instance of the
ControlsScreen
class. - Simulate rendering and resizing operations.
- Verify that specific assets are loaded as expected, e.g., "images/controls-images/Controls.png."
verifyAssetLoaded
Test Case 2: Objective: Ensure that the verifyAssetLoaded
method correctly verifies the loading of assets.
Test Steps:
- Call the
verifyAssetLoaded
method with known loaded and unloaded assets. - Verify that the method correctly identifies loaded assets and asserts their presence.
- Dispose the assets after testing.
Mock Objects
Application
(Mock): Used to simulate application behavior.GdxGame
(Mock): Represents the game instance.ResourceService
(Mock): Simulates resource loading.ServiceLocator
(Mock): Facilitates service registration and retrieval.
Test Setup
Before running the test cases, the necessary mock objects will be created and configured to isolate the ControlsScreen
class.
Conclusion
This test plan ensures that the ControlsScreen
class, responsible for asset loading and screen rendering, behaves as intended. By simulating various scenarios and verifying asset loading, it ensures that the screen is correctly set up for use in the game.