-
Notifications
You must be signed in to change notification settings - Fork 1
Lion Testing
This details the tests run for the creation of a lion entity. It tests various features and ensures the correct creation of that NPC. These tests can be located in NPCFactoryTest.java
and can be found from lines 676 to 757.
-
testLionInitialisation
Checks the initialisation of the NPC by verifying its creation, name, type, and the presence of necessary components. This includes:
-
Verifying that the
lion
object is not null, ensuring it was created successfully. -
Checking if the lion entity has the correct name "Lion" as specified in the configuration.
-
Confirming that the lion object is of type
Entity
, verifying its inheritance or implementation. -
Ensuring the lion entity has a
PhysicsComponent
, which is necessary for physical interactions. -
Validating that the lion entity includes a
PhysicsMovementComponent
, which handles its movement physics. -
Verifying that the lion entity has a
ColliderComponent
for collision detection. -
Checking if the lion entity has a
ConfigComponent
to manage its configuration settings.
-
TestLionHasCorrectSoundPath
: Ensures the sound path for the lion is correctly set to "sounds/tiger-roar.wav" in the configuration. -
TestLionHasCorrectBaseHint
: Confirms that the base hint for the lion is set correctly, matching "Welcome to Animal Kingdom!" and "I am Lenny the Lion." -
TestLionIsFriendly
: Ensures the lion entity has aFriendlyNPCAnimationController
, indicating that it is a non-aggressive NPC.
-
TestLionHasAnimation
: Validates that the lion entity has an idle animation named "float", ensuring visual representation. -
TestLionSetPosition
: Verifies that the lion entity is placed correctly at the specified position (0,0) and can be moved to that location.
![Screenshot 2024-10-03 at 2 49 14 pm](https://private-user-images.githubusercontent.com/161672053/373121772-02599265-5418-48be-8b9d-d7087b65fbaf.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg5NTI0OTQsIm5iZiI6MTczODk1MjE5NCwicGF0aCI6Ii8xNjE2NzIwNTMvMzczMTIxNzcyLTAyNTk5MjY1LTU0MTgtNDhiZS04YjlkLWQ3MDg3YjY1ZmJhZi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjA3JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIwN1QxODE2MzRaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0wNzc2NzU4NWMyY2JmOTdmMTEyYzRhMWI2ZDQ0OGQ0NTE2NDEwN2NiMDlkNjBhNzI3OTEzODUxMDllMjRlZDI2JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.cLyDFi5o9rcVnHU1Qy-qtDbMT1HYRsech3O4Rn51yVA)