JUnit Testing Plan for Cooking Ingredients - UQcsse3200/2024-studio-3 GitHub Wiki
CookingComponent test plan
Purpose
- Ensure that Ingredients get cooked when they are placed into a station once their cook times are met.
- Ensure Timers are set up poperly.
- Ensure the event triggers and listeners work.
- Ensure the ingredient states change when their cook time is met.
- Ensure ingredient becomes burnt if 15 seconds pass after the cook time.
- Ensure that stop cooking working properly.
What wasn't tested:
- Specific calculations and edge cases for the
cookEndTime
calculation inCookIngredientComponent.cookIngredient()
method based on different station types and/or different station states weren't tested. It only tested based on a "NORMAL" station state and the station type set to "COOK_TOP" (CookIngredientComponent.cookIngredient(station_station="NORMAL", oven_multiplier=1)
Setup
Create mock objects for GameTime
, Event_Handlers
, IngredientComponent
. Create Empty Entity
, and initialize a CookIngredientComponent
. Add the 2 components to the entity and call the Enitity.create()
method.
Expected Outcome
Verifies that CookIngredientComponent successfully communicates with the components StationItemHandler
and IngredientComponent
.