Test Plan for SpawnRecipeCommands - UQcsse3200/2024-studio-3 GitHub Wiki
Test Environment
- Framework: JUnit4
- Objects Used: -
Test Cases - Testing SpawnRecipeCommands
Spawn Banana Split Recipe
Purpose:
The purpose of this test is to verify that the SpawnRecipeCommands
can successfully spawn a "Banana Split" meal and add it to the players inventory.
Test Method:
testSpawnBananaSplit()
Expected Outcome:
- The inventory is initially empty and not full.
- A "Banana Split" meal entity is created using mocked ingredients (
strawberry
,chocolate
,banana
). - The spawned meal is added to the players inventory.
- The command returns
true
, indicating success.
Invalid Recipe Argument
Purpose:
The purpose of this test is to verify that the SpawnRecipeCommands
handles invalid recipe names and does not add anything to the inventory.
Test Method:
testInvalidArgument()
Expected Outcome:
- The recipe argument is invalid.
- No item is created or added to the players inventory.
- The command returns
false
, indicating failure.
Spawn Fruit Salad Recipe
Purpose:
The purpose of this test is to verify that the SpawnRecipeCommands
can successfully spawn a "Fruit Salad" meal and add it to the players inventory.
Test Method:
testSpawnFruitSalad()
Expected Outcome:
- The inventory is initially empty and not full.
- A "Fruit Salad" meal entity is created using mocked ingredients (
strawberry
,banana
). - The spawned meal is added to the players inventory.
- The command returns
true
, indicating success.
No arguments provided
Purpose:
The purpose of this test is to verify that the SpawnRecipeCommands
fails to execute when no arguments are provided.
Test Method:
testNoArgs()
Expected Outcome:
- No arguments are passed to the command.
- No item is created or added to the players inventory.
- The command returns
false
, indicating failure due to missing arguments.