Skip to content
bhavyamalik1 edited this page Oct 16, 2024 · 1 revision

Test Environment

  • Framework: JUnit 5
  • Objects Used: Docket (under test), Skin (mocked), Image (mocked)

Test Cases - Testing Docket Component Methods

  1. Docket Initialisation
    Purpose: To verify that the Docket component is properly initialised with default values.
    Expected Results:

    • Two Docket instances (docket and docket2) should be created without errors.
    • The start time of the second docket (docket2) should be initialised and greater than 0.
  2. Get Current Texture Name
    Purpose: To verify that the current texture name is correctly retrieved based on the drawable image assigned.
    Expected Results:

    • When the drawable is set, the returned texture name should match the first texture name in the texture array.
    • When the drawable is null, the returned texture name should be "none".
  3. Update Docket Textures
    Purpose: To verify that the Docket updates its textures correctly based on the remaining recipe time.
    Expected Results:

    • When paused, the texture should not change regardless of time updates.
    • When resumed, the texture should update appropriately based on the remaining time:
      • Remaining time = 1.5s → First texture.
      • Remaining time = 0.3s → Second texture.
      • Remaining time = 1s, total recipe time = 10s → Third texture.
      • Remaining time < 0 → Final texture.
  4. Set and Get Recipe Time
    Purpose: To verify that the recipe time is correctly set and retrieved.
    Expected Results:

    • Setting recipe time to 1.5 should return 1.5 when retrieved.
    • Setting recipe time to 3.8 should return 3.8 when retrieved.
  5. Set and Get Pause State
    Purpose: To ensure that the pause state can be toggled and retrieved correctly.
    Expected Results:

    • After setting paused to true, getPaused() should return true.
    • After setting paused to false, getPaused() should return false.
  6. Set and Get Skin
    Purpose: To verify that a new skin can be assigned to the Docket and retrieved correctly.
    Expected Results:

    • After setting a mocked Skin, getSkin() should return the same Skin instance.
  7. Set and Get Docket Image
    Purpose: To ensure that the docket image can be assigned and retrieved correctly.
    Expected Results:

    • After setting a mocked Image, getDocketImage() should return the same Image instance.
  8. Default Start Time Initialisation
    Purpose: To confirm that the start time is correctly initialised upon docket creation.
    Expected Results:

    • getStartTime() should return a value greater than 0.
  9. Set and Get Cell Hash
    Purpose: To verify that the cell hash value is correctly assigned and retrieved.
    Expected Results:

    • Setting the cell hash to 12345 should return 12345 when retrieved.
  10. Get Texture Name Array
    Purpose: To confirm that the texture name array is initialised with the correct values and length.
    Expected Results:

    • getTextureNameArray() should not return null.
    • The length of the texture name array should be 4.

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