-
Notifications
You must be signed in to change notification settings - Fork 9
Test plan For TutNpc Animation Controller
The TutnpcAnimationController
class is responsible for managing animations for the Tutnpc (Tutorial NPC) entity in the game. This wiki page provides documentation for the class and its associated test class.
The TutnpcAnimationController
ensures proper animation handling and updates for the Tutnpc entity.
- Description: Initializes the animation controller and triggers the initial animation.
- Description: Updates the animation state based on the animation duration and the current animation.
The TutnpcAnimationControllerTest
class is responsible for testing the methods of the TutnpcAnimationController
class to ensure proper functionality.
-
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 TutnpcAnimationController
will be initialized with these mock objects for testing purposes.
Before running the test cases, the necessary mock objects and dependencies are set up for testing. The TutnpcAnimationController
is initialized with 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 theTutnpcAnimationController
. - Verify that the
startAnimation
method of the mockAnimationRenderComponent
is called with the expected animation key ("row-2-column-1").
Objective: Ensure that the update
method of the TutnpcAnimationController
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-3-column-1"). - Call the
update
method of theTutnpcAnimationController
.
This wiki page provides documentation for the TutnpcAnimationController
class and its associated test class, TutnpcAnimationControllerTest
. By using test cases and mock objects, we ensure that the animation controller functions correctly and can be reliably tested to maintain the reliability and correctness of the Tutnpc animation system in the game.
Escape Earth Game
Interaction Controller and Interactable Components
Game and Entity Configuration Files
Loading Game Configuration Files