-
Notifications
You must be signed in to change notification settings - Fork 2
Test Plan For MealComponent
- Framework: JUnit 5
- Extension: GameExtension.class
Dependencies:
- IngredientComponent
- MealComponent
- ItemType enum
The purpose of this test plan is to verify the functionality of the MealComponent class in the game. The test focuses on ensuring that the MealComponent is properly constructed and its properties, such as name, type, weight, ingredients, price, and quality, are correctly calculated.
Ingredients Setup: Three IngredientComponent instances are created to simulate different types of ingredients used in meals:
- Tomato: Raw state with specific quality attributes.
- Cucumber: Cooked state with specific quality attributes.
- Beef: Burnt state with specific quality attributes.
Test Case: MealComponent Constructor Test Purpose: Verify that the MealComponent is properly constructed with the correct name, type, weight, list of ingredients, price, and calculated quality. Setup: Create a list of three ingredients (Tomato, Cucumber, Beef) and use them to construct a MealComponent representing a "steakMeal."
- Assert that the meal name is set correctly to "steakMeal".
- Assert that the item type is ItemType.STEAKMEAL.
- Assert that the weight of the meal is correctly set to 32.
- Assert that the list of ingredients matches the expected list (Tomato, Cucumber, Beef).
- Assert that the price is correctly set to 20.
- Assert that the calculated quality of the meal is correct (33).
The test should pass if the MealComponent constructor correctly initializes all the fields based on the provided ingredients and the meal's attributes.
The test primarily covers the constructor and getters for MealComponent. The calculation of quality based on ingredient states (raw, cooked, burnt) is also indirectly verified.
This test plan ensures that the MealComponent constructor works as expected and that the class properties are initialized and calculated correctly. Additional test cases can be added to cover more complex scenarios and edge cases.
Inventory System
Scoring System
Food Recipes
Level System
Player Actions
Ordering System
Stations
Items
Map Design
Customers
Pause Menu
Upgrades
End of Day Display
Day Night Cycle
Moral System
Debug Terminal
Game Interactions Tutorial
Backstory Cutscenes
Entities and Components
Input Handling
Game Screens and Areas
Fire Extinguisher Handler Component
MainGameActions Create Docket Triggers
Main Game Order Button Display
BackstoryCutsceneDisplay Test Plan
Test Plan for MainGameOrderTicketDisplay
Test Plan for MainGameOrderBtnDisplay
Test Plan for DocketLineDisplay
Test plan for RandomComboService
Test plan for SpeedBoostUpgrade
Test plan for DancePartyUpgrade