EntityConverter Testing - UQcsse3200/2024-studio-2 GitHub Wiki
Testing
This details the tests for various features specific to enemy NPCs and tests the removal of their enemy components. These tests are run with each type of enemy NPC that will be available to be used as a friendly NPC companion. Some of these are the chicken, frog, bear and monkey.
These tests can be found in the ForestGameAreaTest.java
and NPCFactoryTest.java
files.
ForestGameAreaTest
testSpawnConvertedNPCWithNullEntity()
- Tests that spawnConvertedNPCs()
does not create any entity when a null entity is passed through.
testSpawnConvertedNPCWithNullEnemyType()
- Tests that spawnConvertedNPCs()
does not create any entity when the enemy type is null.
NPCFactoryTest
testInitiateDialogue()
- Tests that initiateDialogue functions as expected.
The below tests are identical in testing for functionality for the other three convertible enemies tested being monkey, bear and frog.
testChickenInitialisation()
- Tests that the friendly chicken is correctly initialised.testChickenHasCorrectBaseHint()
- Tests that the friendly chicken has the correct base hint.testChickenIsFriendly()
- Tests that the friendly chicken is indeed friendly AKA has a friendly AI controller.testChickenSetPosition()
- Tests that the friendly chicken is in the correct spot when placed.