Skip to content

Main Game Order Button Display

bhavyamalik1 edited this page Oct 16, 2024 · 1 revision

Test Environment

  • Framework: JUnit 5
  • Objects Used:
    • MainGameOrderBtnDisplay (under test)
    • RenderService, Stage, DocketService (mocked)
    • Entity, SpriteBatch (mocked)

Test Cases - Testing MainGameOrderBtnDisplay Component Methods

  1. Component Setup
    Purpose: To ensure that the MainGameOrderBtnDisplay component is correctly initialised and registered with required services.
    Expected Results:

    • RenderService and DocketService should be mocked and registered with ServiceLocator.
    • The stage for the button display should be correctly assigned during setup.
  2. Button Creation
    Purpose: To verify that the button display correctly adds UI actors when the addActors() method is called.
    Expected Results:

    • The addActors() method should be called at least once during the test.
  3. Component Association with Entity
    Purpose: To verify that the MainGameOrderBtnDisplay component is correctly associated with an Entity.
    Expected Results:

    • Adding the button display to an entity should allow retrieval of the same entity through getEntity().
  4. Dispose Method Functionality
    Purpose: To ensure that the dispose() method correctly clears UI elements when called.
    Expected Results:

    • Before disposal, the table should contain children elements.
    • After calling dispose(), the table should have no children elements.
  5. Dummy Test for Draw Method
    Purpose: To acknowledge that the draw() method currently performs no meaningful operations.
    Expected Results:

    • The draw() method should run without exceptions or side effects.
  6. Get Z Index
    Purpose: To confirm that the ZIndex of the button display is correctly set.
    Expected Results:

    • getZIndex() should return 2f.
  7. Get and Set State
    Purpose: To verify that the state of the button display can be toggled and retrieved correctly.
    Expected Results:

    • Setting the state to true should return true from getState().
    • Setting the state to false should return false from getState().

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