-
Notifications
You must be signed in to change notification settings - Fork 1
Testing Plan for WeaponAnimationController component
The purpose of this test plan is to validate the functionality of the WeaponAnimationController
class, which manages the animation logic for weapon entities and their connection to players. The tests aim to ensure the correct creation of the animation controller, and the connection and disconnection behavior of the controller when attached to a player.
Framework: JUnit 5 with Mockito for mocking dependencies
Objects Used:
-
WeaponAnimationController
class for managing weapon animations. -
Entity
class representing the player entity. -
WeaponFactory
for creating weapon objects (mocked). -
NameComponent
to assign names to entities (e.g., "Ranged").
Setup:
- The
beforeEach()
method registers necessary services such asRenderService
,EntityService
,PhysicsService
, andResourceService
. - Mocks are created for
WeaponFactory
andEntity
(player entity). - Projectiles' texture atlases are loaded to simulate game assets.
Objective: Validate the successful creation of the WeaponAnimationController
.
Setup: Instantiate a new WeaponAnimationController
.
Expected Outcome:
- The
WeaponAnimationController
instance is successfully created and is not null.
Objective: Ensure the WeaponAnimationController
correctly connects and disconnects a player entity.
Setup:
- Create a new
WeaponAnimationController
. - Add the
WeaponAnimationController
to the player entity. - Add a
NameComponent
to the player entity with the name "Ranged". - Connect the player to the
WeaponAnimationController
. - Disconnect the player from the
WeaponAnimationController
.
Expected Outcome:
- After connecting, the
connected
property of theWeaponAnimationController
should betrue
. - After disconnecting, the
connected
property of theWeaponAnimationController
should befalse
.
This test plan ensures that the WeaponAnimationController
class behaves as expected when creating the controller, connecting a player entity, and disconnecting the player, with proper state management for the connection status.
Design Choices
Utilities
Animals
Menus/screens
Character
- Character Animations
- Character's Inventory On Display
- Character's Inventory System
- Character's HealthBar
- Character's Interaction with Items
- Character achievements
- Saving Character
- Player-(and-other-NPC)-invincibility-frames
- Player Factory
- Scoring System
- Test Plan for Inventory System
- Test Plan for Player's Interaction with Items
- Test Plan for Player's Inventory Display
- Test Plan for Saving Character State
- Test Plan for Scoring System
Map
Weapon
- Weapon Overview
- Weapon Types
- Weapon Structure
- Weapon Stats Display
- Testing Plan for Weapon Factory
- Testing Plan for Firing Controller Component
- Testing Plan for Position Tracker Component
- Testing Plan for Weapon Animation Controller component
- Testing Plan for Concrete Melee Weapon class
- Testing Plan for Concrete Ranged Weapon class