Test Plan for Minimap - UQcsse3200/2024-studio-1 GitHub Wiki

Objective

The purpose of this test plan is to validate the functionality of the MinimapTile class within the Minimap system. This class represents individual tiles used in the minimap and is crucial for correct minimap rendering.

Test Environment

  • Framework: JUnit 5 (Jupiter)
  • Extensions: Mockito for mocking dependencies
  • Objects Used: MinimapTile class under test, TextureRegion for tile textures

setup() method

  • The setUp() method initializes key components before each test case:
  • TextureRegion (textureRegion): Mocked using Mockito to represent the tile's texture.
  • MinimapTile (minimapTile): A new instance created with the mocked TextureRegion.

Test Cases

Initialization and ID Management

  1. Objective: Validate that the MinimapTile correctly manages its ID. 2._ Setup_: Set the tile ID to 5.
  2. Expected Outcome: getId() returns 5.

Blend Mode Management

  1. Objective: Ensure that the MinimapTile correctly handles blend modes.
  2. Setup:
  • Check initial blend mode - Initial blend mode is ALPHA.
  • Set blend mode to NONE.
  1. Expected Outcome: After setting, getBlendMode() returns NONE.

Texture Region Management

  1. Objective: Verify that the MinimapTile correctly manages its TextureRegion.
  2. Setup:
  • Check initial TextureRegion.
  • Set a new TextureRegion.
  1. Expected Outcome: Initial TextureRegion matches the one set in constructor. After setting, getTextureRegion() returns the new TextureRegion.

Execution

Tests were executed using the JUnit 5 framework within the development environment. Each test case passed independently, confirming the integrity and correctness of the MinimapTile class. By following this test plan, we can ensure that the MinimapTile class functions correctly within the larger Minimap system,