Skip to content

PlateComponent Test Plan

Airyl Suaidi edited this page Sep 9, 2024 · 2 revisions

Overview

The PlateComponentTest class is th unit testing the PlateComponent class, which models a plate entity in the game with various properties such as quantity, item status, and availability. The test cases aim to verify that the component behaves as expected when initialized, manipulated, and interacted with through various operations

Test Case

  1. PlateComponent Constructor Test
  • Objective: Validate that the PlateComponent constructor initializes the component with the correct values for quantity and default params
  • Testing Steps:
    1. Create an instance of PlateComponent with a specified quantity (e.g., 3)
    2. Assert that the properties quantity, isStacked, id, and plateArray are correctly set
  • Expected Result: All assertions should pass, confirming that the constructor correctly initializes the PlateComponent instance
  1. Add Meal to Plate Test
  • Objective: Validate that adding a meal to the plate correctly updates the plat item status, availability, and servability
  • Testing Steps:
    1. Set the plate quantity to 2
    2. Add a meal (e.g “Steak”) to the plate
    3. Assert that the item on the plate is correctly set, availability is false, and servability is true
  • Expected Result: The item should be correctly added, the plate should not be available, and it should be servable
  1. Unavailable After Dispose Test
  • Objective: Confirm that disposing of the plate makes it unavailable
  • Testing Steps:
    1. Call the dispose method on the PlateComponent
    2. Assert that the plate is no longer available
  • Expected Result: The plate should be marked as unavailable after disposal
  1. Quantity Initialization Test
  • Objective: Verify that the initial quantity of the plate matches the value passed during instantiation
  • Testing Steps:
    1. Check the quantity of the plate after instantiation
  • Expected Result: The initial quantity should match the expected value (e.g., 3)
  1. Set Quantity Test
  • Objective: Ensure that setting a new quantity updates the plate quantity correctly
  • Testing Steps:
    1. Set the quantity to a new value (e.g., 5)
    2. Assert that the plate quantity matches the new value
  • Expected Result: The plate quantity should be updated to 5
  1. Washed State After Instantiation Test
  • Objective: Confirm that the plate is in a washed state upon instantiation
  • Testing Steps:
    1. Check the washed status of the plate after instantiation
  • Expected Result: The plate should be marked as washe
  1. Availability After Instantiation Test
  • Objective: Validate that the plate is available for use immediately after instantiation
  • Testing Steps:
    1. Check the availability status of the plate
  • Expected Result: The plate should be availabl
  1. Not Servable After Instantiation Test
  • Objective: Ensure that the plate is not servable immediately after instantiation
  • Testing Steps:
    1. Check the servability status of the plate
  • Expected Result: The plate should not be servable initially
  1. Set ID Test
  • Objective: Confirm that setting the ID of the plate updates the ID correctly
  • Testing Steps:
    1. Set the ID to a specific value (e.g 1)
    2. Assert that the plate Id matches the given value
  • Expected Result: The plate Id should be correctly updated

Test Structure

Setup: Mock Entities are setup prior testing

Assertions: The tests primarily use assertions such as assertEquals, assertTrue, assertFalse, assertNotNull, and assertArrayEquals to validate the expected outcomes

Test Execution

Each test method is constructed to try to maximize the amount of coverage test code being cover.

Table of Contents

Home

Team Design Document

Game Features

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

Game

Getting Started

Entities and Components

World Backstory

Service Locator

Loading Resources

Logging

Unit Testing

Debug Terminal

Input Handling

UI

Animations

Audio

AI

Physics

Game Screens and Areas

Terrain

Concurrency & Threading

Settings

Map Design

Test Plans

Sensor Component

Customer Sensor Component

Interaction Component

Inventory Component

Inventory Display

Station Meal Component

Station Progress Display

Keyboard Input Component

Fire Extinguisher Handler Component

Score System

HoverBox Component

MainGameActions Create Docket Triggers

End Day Display Component

Cutscene Area

Docket

Docket Line Display

Docket Meal Display

Main Game Order Button Display

Order Actions

Recipe

Ticket Details Component

BackstoryCutscene Test Plan

BackstoryCutsceneDisplay Test Plan

Test Plan for Tutorial

Keybinds

Keybinds Test Plan

Test Plan for MainGameOrderTicketDisplay

Test Plan for MainGameOrderBtnDisplay

Test Plan for Docket

Test Plan for DocketLineDisplay

Test Plan for OrderActions

Ticket Details

Test plan for RandomComboService

Test plan for LoanUpgrade

Test plan for UpgradesDisplay

Test plan for RageUpgrade

Test plan for SpeedBoostUpgrade

Test plan for DancePartyUpgrade

Test plan for ExtortionUpgrade

Troubleshooting

MacOS Setup Guide

Clone this wiki locally