-
Notifications
You must be signed in to change notification settings - Fork 9
Test Plans For Astro Animation Controller
This wiki page provides documentation for the test plan of the AstroAnimationController
class. The AstroAnimationController
is responsible for controlling the animations of an Astro 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 AstroAnimationController
class is responsible for managing animations for the Astro 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 AstroAnimationController
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 theAstroAnimationController
. - Verify that the
startAnimation
method of the mockAnimationRenderComponent
is called with the expected animation key ("Astro_Down"). - Verify that the
AssetManager
is called to load the Astro NPC texture atlas. - Verify that the
AssetManager
is called to finish loading.
Objective: Ensure that the update
method of the AstroAnimationController
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., "Astro_Up"). - Call the
update
method of theAstroAnimationController
. - 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 AstroAnimationController
class, ensuring that it functions correctly in managing animations for the Astro 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 Astro NPC animation system in the game.
Escape Earth Game
Interaction Controller and Interactable Components
Game and Entity Configuration Files
Loading Game Configuration Files