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

The purpose of this plan is to test the basic functionality of the collection components.

Test Environment

  • Framework: JUnit4
  • Objects Used: Fridge, Produce Basket

Test Cases - Testing CollectionComponent

Collecting Fish Item

Purpose:

The purpose of this test is to verify that the StationCollectionComponent correctly collects and returns a fish entity.

Test Method:

TestCollection1()

Expected Outcome:

When the collectItem("fish") is called, the returned entity should contain an IngredientComponent with ItemType.FISH.

Collecting Beef Item

Purpose:

The purpose of this test is to verify that the StationCollectionComponent correctly collects and returns a beef entity.

Test Method:

TestCollection2()

Expected Outcome:

When the collectItem("beef") is called, the returned entity should contain an IngredientComponent with ItemType.BEEF.

Failing to Collect an Invalid Item

Purpose:

The purpose of this test is to verify that the StationCollectionComponent correctly handles an invalid or unrecognised item request.

Test Method:

TestCollectionFail()

Expected Outcome:

  • When collectItem("not an option") is called, the method should return null, indicating that the item is not collectible.