Test Plan for CookIngredientComponent - UQcsse3200/2024-studio-3 GitHub Wiki
The purpose of this plan is to test the basic functionality of the cook ingredient component.
Test Environment
- Framework: JUnit4
- Objects Used: Oven, stove
Test Cases - Testing CookIngredientComponent
Ingredient starts cooking
Purpose:
The purpose of this test is to verify that an ingredient starts cooking when the cooking event is triggered.
Test Method:
testCookingStarts()
Expected Outcome:
When the 'cookIngredient' event is triggered, the getIsCooking()
method of the CookIngredientComponent
should return true
.
Test ingredient becomes cooked
Purpose:
The purpose of this test is to verify that an ingredient becomes cooked after a certain event is triggered.
Test Method:
testIngredientBecomesCooked()
Expected Outcomes:
- When the 'cookIngredient' event is triggered, the cooking process should start.
- After the specified time has passes the
cookItem()
method should be triggered on theIngredientComponent
.
Test that ingredient stops cooking
Purpose:
The purpose of this test is to verify that the cooking process stops when the stopCookingIngredient
event is triggered.
Test Method:
testStopCooking()
Expected Outcome:
- When the 'stopCookIngredient' event is triggered, the
getIsCooking()
method should returnfalse
.
Test that ingredient becomes burnt
Purpose:
The purpose of this test is to verify that the ingredient becomes burnt if too much time has passed since it was cooked.
Test Method:
testIngredientBecomesBurnt()
Expected Outcome:
- After the cooking time has passed and the ingredient is cooked, the
burnItem
method on theIngredientComponent
should be triggered. - The cooking process should stop and the
getIsCooking
method should returnfalse
Test that rage mode affects cooking
Purpose:
The purpose of this test is to verify that rage mode affects the cooking time.
Test Method:
testRageMode
Expected Outcome:
- When the
rageModeOn
event is triggered cooking times should be reduced allowing the ingredient to cook faster. - The
cookItem()
method should be called after a reduced amount of time compared to normal conditions.