Skip to content

LoanUpgrade

willembor edited this page Oct 3, 2024 · 2 revisions

Test Environment

  • Framework: JUNIT 5
  • Dependencies:
  • LoanUpgrade: Class being tested
  • CombatStatsComponent: Mocked to simulate players gold status
  • Entity: Represents player entity
  • EventHandler: Triggers various events
  • ServiceLocater: Retrieves certain services such as PlayerService & RandomComboService
  • RandomComboService: handles random combo events
  • Gdx and Input: simulates key presses

Test Cases

1. activate when sufficient gold

  • Purpose: Verifies that activate method adds gold

  • Setup:

    • Mock CombatStatsComponent to return 20 gold when getGold is called
    • Invoke activate method on instance
  • Expected Outcome: that addGold method of CombatStatsComponent is called with arg 100 to add gold to player

2. not activate when insufficient gold

  • Purpose: To ensure activate triggers the "notenoughmoney" event if player has insufficient money
  • Setup: Mocks CombatStatsComponent and invokes activate
  • Expected Outcome: the trigger method of randomComboServiceEvents is called when arg is "notenoughmoney"

3. activates when key is pressed

  • Purpose: To verify the update method calls activate when L is pressed

  • Setup:

    • use reflection to mock Gdx.input to simulate key presses
    • Mock input to return true when L is pressed
    • Spies on LoanUpgrade to monitor calls to activate
    • Calls update method
  • Expected Outcome: activate method on loanupgrade is called when L is pressed

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