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

Test Environment

  • Framework: JUnit4
  • Objects Used: Bin

Test Cases - Testing StationBinComponent

Bin Does Not Accept Non-Default Interaction

Purpose:

The purpose of this test is to verify that the stationBinComponent does not remove items from the players inventory when a non-default interaction occurs.

Test Method:

TestBinDoesntAcceptNonDefaultInteraction()

Expected Outcome:

  • The players inventory should still contain the item after a non default interaction.
  • The item should remain registered in the EntityService

Bin Handles Default Interaction Through Direct Call

Purpose:

The purpose of this test is to verify that the stationBinComponent correctly removes the item from the players inventory when a default interaction is triggered directly.

Test Method:

TestBinHandlesDefaultInteractionDirectCall()

Expected Outcome:

  • The item should be removed from the players inventory.
  • The item should be unregistered from the EntityService.

Bin Handles Default Interaction Through Event Listener

Purpose:

The purpose of this test is to verify that the stationBinComponent correctly processes a default interaction when triggered through an event listener.

Test Method:

TestBinHandlesDefaultInteractionThroughEventListener()

Expected Outcome:

  • The item should be removed from the players inventory after the event is triggered.
  • The item should be unregistered from the EntityService.