Test Plan for IngredientStationHandlerComponent - UQcsse3200/2024-studio-3 GitHub Wiki
The purpose of this plan is to test the basic functionality of the StationFactory
calsss components.
Test Environment
- Framework: JUnit4
- Objects Used:
IngredientStationHandler
,InventoryComponent
,StationCollectionComponent
Test Cases - Testing IngredientStationHandlerComponent
Test that Station Gives Item to Player
Purpose:
The purpose of this test is to verify that the station gives the correct item to the player.
Test Method:
testStationGivesItemToPlayer()
Expected Outcome:
- The player inventory should contain the item provided by the station.
- The station should spawn another item in it after a player collects one.
- The player inventory display should be updated.
Test Interaction When Full Inventory
Purpose:
The purpose of this test is to verify that no item should be added to inventory if it is full already.
Test Method:
testStationInteractionWhenPlayerInventoryIsFull()
Expected Outcome:
- The player inventory should remain full and unchanged.
- The station inventory should remain the same with no item being removed or replaced.
Test Station Repopulate After Giving Item
Purpose:
The purpose of this test is to verify that a station respawns an item in its inventory after the player takes one out of it.
Test Method:
testStationRepopulatesAfterGivingItem()
Expected Outcome:
- The player should receive the item from the stations inventory.
- The station should immediately repopulate the item that was taken.
Test No Interaction on Non-Default Type
Purpose:
The purpose of this test is to verify that the interaction with the station does not occur if the interaction type is different from the expected default
type.
Test Method:
testNoInteractionOnNonDefaultType()
Expected Outcome:
- The player inventory should remain unchanged with no item added.
- The stations inventory should remain unchanged with no item removed.