Skip to content

DroidAnimationController Test Plan

Mohamad Dabboussi edited this page Sep 11, 2023 · 2 revisions

Test Plan for DroidAnimationController

Introduction

In a game, smooth animations for entities like DroidTower not only enhance visual aesthetics but also provide intuitive cues to the player. This test plan outlines the approach for validating that the DroidAnimationController functions as expected and triggers the right animations for various events.

Objective

The main aim of these tests is to ensure that DroidAnimationController correctly triggers the following animations based on event names:

  • "walk" animation when "walkStart" event is triggered.
  • "idle" animation when "idleStart" event is triggered.
  • "goUp" animation when "goUpStart" event is triggered.
  • "goDown" animation when "goDownStart" event is triggered.
  • "attackUp" animation when "attackUpStart" event is triggered.
  • "attackDown" animation when "attackDownStart" event is triggered.
  • "death" animation when "deathStart" event is triggered.

Methodology

Setup (BeforeEach)

  1. Initialize necessary services and resources for testing using ServiceLocator.
  2. Register PhysicsService, ResourceService, and RenderService with ServiceLocator.
  3. Load textures and texture atlases for the DroidTower using a new ResourceService instance.

Test Cases

Test Case 1: testAnimateWalk

Objective: To verify that the "walk" animation plays when "walkStart" is triggered.

Steps:

  1. Trigger the "walkStart" event on the entity.
  2. Verify that the AnimationRenderComponent's getCurrentAnimation method returns "walk".

Test Case 2: testAnimateDefault

Objective: To verify that the "idle" animation plays when "idleStart" is triggered.

Steps:

  1. Trigger the "idleStart" event on the entity.
  2. Verify that the AnimationRenderComponent's getCurrentAnimation method returns "idle".

Test Case 3: testAnimateGoUp

Objective: To verify that the "goUp" animation plays when "goUpStart" is triggered.

Steps:

  1. Trigger the "goUpStart" event on the entity.
  2. Verify that the AnimationRenderComponent's getCurrentAnimation method returns "goUp".

... The same testing procedure will be applied for the rest of the events

Assumptions

  1. The ServiceLocator class functions as expected and has been previously tested.
  2. The AnimationRenderComponent class has methods and behavior that are correctly implemented.
  3. External extensions such as MockitoExtension and GameExtension function as expected.

This should cover the basic testing requirements for the DroidAnimationController. Remember to execute these tests regularly, especially when there are code changes affecting animation logic.

Clone this wiki locally