-
Notifications
You must be signed in to change notification settings - Fork 9
Test plan for Astronaut Animation controller
This wiki page provides documentation for the test plan of the AstronautAnimationController
class. The AstronautAnimationController
is responsible for controlling the animations of an Astronaut NPC entity in the game. The purpose of these tests is to ensure that the animation controller behaves as expected and handles animations and updates correctly.
The AstronautAnimationController
class is responsible for managing animations for the Astronaut NPC entity in the game. This test plan outlines the strategy for testing the key methods of this class to ensure proper animation handling and updates.
Before running the test cases, we will set up the necessary objects and dependencies for testing. Mock objects will be used for dependencies to isolate the class under test.
-
AssetManager
(Mock): Used to simulate asset loading. -
AnimationRenderComponent
(Mock): Used to simulate rendering animations. -
TextureAtlas
(Mock): Used to simulate the texture atlas for animations.
The AstronautAnimationController
will be initialized with these mock objects for testing purposes.
Objective: Verify that the create
method correctly initializes the animation controller and triggers the initial animation.
Test Steps:
- Call the
create
method of theAstronautAnimationController
. - Verify that the
startAnimation
method of the mockAnimationRenderComponent
is called with the expected animation key ("row-1-column-1").
Objective: Ensure that the update
method of the AstronautAnimationController
correctly updates the animation state based on the animation duration and the current animation.
Test Steps:
- Set the
animationDuration
property of the controller to a specific value (e.g., 10f). - Mock the
getCurrentAnimation
method of theAnimationRenderComponent
to return a specific animation key (e.g., "row-1-column-2"). - Call the
update
method of theAstronautAnimationController
. - Verify that the
AnimationRenderComponent
updates the animation state accordingly based on the specified animation key and duration.
This test plan provides a comprehensive approach to testing the AstronautAnimationController
class, ensuring that it functions correctly in managing animations for the Astronaut NPC entity. By using mock objects and specifying expected behavior, we validate the initialization, animation triggering, and animation updates of the controller. These tests help maintain the reliability and correctness of the Astronaut NPC animation system in the game.
Escape Earth Game
Interaction Controller and Interactable Components
Game and Entity Configuration Files
Loading Game Configuration Files