Skip to content

DocketLineDisplay

bhavyamalik1 edited this page Oct 16, 2024 · 1 revision

Test Environment

  • Framework: JUnit 5
  • Objects Used:
    • DocketLineDisplay (under test)
    • Stage, Image, Table, Skin, Texture (mocked)
    • ServiceLocator, RenderService, ResourceService (mocked)

Test Cases - Testing DocketLineDisplay Component Methods

  1. Class Setup and Teardown
    Purpose: To ensure that services are correctly registered with the ServiceLocator and cleared after all tests.
    Expected Results:

    • RenderService and ResourceService should be mocked and registered correctly.
    • After tests complete, the ServiceLocator should be cleared.
  2. Batch Initialisation
    Purpose: To verify that the SpriteBatch used in the tests is correctly initialised.
    Expected Results:

    • batch should not be null.
  3. Create Method
    Purpose: To verify that DocketLineDisplay correctly adds UI components to the stage upon creation.
    Expected Results:

    • The create() method should add actors to the stage at least once.
  4. Resize Method
    Purpose: To ensure that the UI is correctly reset and components are re-added upon resizing.
    Expected Results:

    • The pinLine image should be removed.
    • The table should be cleared.
    • The stage should receive new actors at least once.
  5. Dispose Method
    Purpose: To verify that DocketLineDisplay correctly disposes of resources.
    Expected Results:

    • The table should be cleared upon calling dispose().
  6. Get and Set PinLine
    Purpose: To ensure that the pinLine image can be assigned and retrieved correctly.
    Expected Results:

    • Setting a new Image as the pin line should allow the same Image to be retrieved with getPinLine().
  7. Get and Set Table
    Purpose: To ensure that the Table object can be assigned and retrieved correctly.
    Expected Results:

    • Setting a new Table should allow the same Table to be retrieved with getTable().
  8. Get and Set Stage
    Purpose: To verify that the Stage object can be assigned and retrieved correctly.
    Expected Results:

    • Setting a new Stage should allow the same Stage to be retrieved with getStage().
  9. Get Z Index
    Purpose: To confirm that the ZIndex of DocketLineDisplay is correctly set.
    Expected Results:

    • getZIndex() should return 2f.
  10. Draw Method
    Purpose: To verify that the draw() method works correctly with the SpriteBatch.
    Expected Results:

    • Since drawing is managed by the Stage, batch interactions do not need to be verified.

The following video demonstrates the resizing functionality added to DocketLineDisplay.

pinline_resize.mov

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