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 and cook times are met.
- Ensure that Event triggers and listeners work.
- Ensure that Timers work by registering with
ServiceLocator. - Ensure accurate transitions of ingredient states when its cook time is met.
- Ensure cooking stops as expected.
- Ensure ingredients get burnt when they are placed on a station 15 seconds or longer after their cook times are met.
What wasn't tested:
- Specific calculations and edge cases of
endCookTimemember variable ofCookIngredientComponentweren't explored. Nor were station types or states taken into account for the testing. The testing used the basic station type "COOK_TOP" and station state was set to "NORMAL'.i.e., the triggers resulted in a call to `CookIngredientComponent.cookIngredient(Station_state="NORMAL", oven_multiplier=1)
Setup
Create mock objects for GameTime, Event_Handler, IngredientComponent. Initializes new Entity and new CookIngredientComponent. The 2 components are added to the Entity, and then Entity.create() is called to setup the ECS lifecycle.
Expected Outcome
Verifies that CookIngredientComponent successfully interacts with the components StationItemHandler and IngredientComponent.