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

  1. 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.
  2. 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.
  3. 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.
  4. Case-Insensitive Meal Name Matching
    Purpose: To ensure that the getMealImage() 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.
  5. Invalid Meal Names Return Null
    Purpose: To verify that invalid or unsupported meal names return null.
    Expected Results:

    • Providing meal names such as "pasta" or "burger" should return null regardless of the type.
  6. Handling Null and Empty Strings
    Purpose: To ensure that the method handles null and empty strings gracefully.
    Expected Results:

    • Providing a null or empty string for the meal name should return null.
    • Providing a null type should default to returning horizontal images.