Skip to content

Test Plan for Controls Screen

JivalX edited this page Oct 5, 2023 · 5 revisions

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

  1. Verify that asset loading in ControlsScreen works correctly.
  2. Confirm that rendering and resizing methods in ControlsScreen function as expected.
  3. Ensure that specific assets are loaded as intended.

Test Cases

Test Case 1: testControlsScreenAssetLoading

Objective: Verify that asset loading in ControlsScreen is functioning correctly.

Test Steps:

  1. Create an instance of the ControlsScreen class.
  2. Simulate rendering and resizing operations.
  3. Verify that specific assets are loaded as expected, e.g., "images/controls-images/Controls.png."

Test Case 2: verifyAssetLoaded

Objective: Ensure that the verifyAssetLoaded method correctly verifies the loading of assets.

Test Steps:

  1. Call the verifyAssetLoaded method with known loaded and unloaded assets.
  2. Verify that the method correctly identifies loaded assets and asserts their presence.
  3. Dispose the assets after testing.
image

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.

Contributors

Clone this wiki locally