Docket Meal Display - UQcsse3200/2024-studio-3 GitHub Wiki
Test Environment
- Framework: JUnit 5
- Objects Used:
DocketMealDisplay(under test)
Test Cases - Testing DocketMealDisplay Component Methods
-
Retrieve Meal Docket Textures
Purpose: To verify that the static array of meal docket textures is correctly returned.
Expected Results:- The
getMealDocketTextures()method should return an array of 10 textures. - The returned array should contain both vertical and horizontal texture paths.
- The
-
Retrieve Meal Image for Vertical Type
Purpose: To verify that the correct meal image is returned when the type is"vertical".
Expected Results:- For
"salad", the image path should be"images/ordersystem/salad_docket.png". - For
"fruitSalad", the image path should be"images/ordersystem/fruit_salad_docket.png". - For
"steakMeal", the image path should be"images/ordersystem/steak_meal_docket.png". - For
"acaiBowl", the image path should be"images/ordersystem/acai_bowl_docket.png". - For
"bananaSplit", the image path should be"images/ordersystem/banana_split_docket.png". - For any other meal name, the method should return
null.
- For
-
Retrieve Meal Image for Horizontal Type
Purpose: To verify that the correct meal image is returned when the type is not"vertical".
Expected Results:- For
"salad", the image path should be"images/ordersystem/salad_docket_vertical.png". - For
"fruitSalad", the image path should be"images/ordersystem/fruit_salad_docket_vertical.png". - For
"steakMeal", the image path should be"images/ordersystem/steak_meal_docket_vertical.png". - For
"acaiBowl", the image path should be"images/ordersystem/acai_bowl_docket_vertical.png". - For
"bananaSplit", the image path should be"images/ordersystem/banana_split_docket_vertical.png". - For any other meal name, the method should return
null.
- For
-
Case-Insensitive Meal Name Matching
Purpose: To ensure that thegetMealImage()method matches meal names in a case-insensitive manner.
Expected Results:- Providing
"Salad","fruitSalad", or"STEAKMEAL"as the meal name should still return the correct image path.
- Providing
-
Invalid Meal Names Return Null
Purpose: To verify that invalid or unsupported meal names returnnull.
Expected Results:- Providing meal names such as
"pasta"or"burger"should returnnullregardless of the type.
- Providing meal names such as
-
Handling Null and Empty Strings
Purpose: To ensure that the method handles null and empty strings gracefully.
Expected Results:- Providing a
nullor empty string for the meal name should returnnull. - Providing a
nulltype should default to returning horizontal images.
- Providing a