Test Plan for StationChoppingComponent - UQcsse3200/2024-studio-3 GitHub Wiki

The purpose of this plan is to test the basic functionality of the chopping component.

Test Environment

  • Framework: JUnit4
  • Objects Used: Chopping Board

Test Cases - Testing ChoppingComponent

Ingredient Starts Chopping

Purpose:

The purpose of this test is to verify that an ingredient starts chopping when the chopping event is triggered.

Test Method:

IngredientStartsChopping()

Expected Outcome:

When the 'Chop Ingredient' event is triggered, the getIsChopping() method of the ChopIngredientComponent should return true.

Ingredient Stops Chopping After Starting

Purpose:

The purpose of this test is to verify that an ingredient starts chopping and then stops when a certain event is triggered.

Test Method:

IngredientStopsChoppingThenStarts()

Expected Outcomes:

  • When the 'Chop Ingredient' event is triggered, the getIsChopping() method should return true.
  • When the 'Stop Chopping Ingredient' event is triggered, the event getIsChopping method should return false.

Test that ingredient chops

Purpose:

The purpose of this test is to verify that an ingredient completes chopping after the specified chopping duration has elapsed.

Test Method:

TestIngredientChops()

Expected Outcome:

  • When the 'Chop Ingredient' event is triggered, the getIsChopping() method should return true.
  • After chopEntity.update() is called, chopItem() should be triggered, and getIsChopping() should return false.

Test that rage mode reduces chopping time

Purpose:

The purpose of this test is to verify that the rageMode event triggers reduced chopping time.

Test Method:

testRageMode()

Expected Outcome:

  • When the rageModeOn event is triggered, the ingredient should be chopped instantly as set by the chopIngredient trigger called as soon as rage mode is turned on.