Skip to content

Testing Plan for DayNight cycle and JUnit Tests

Calvin John edited this page Sep 12, 2024 · 1 revision

DayNightService Test Plan

Purpose

Creating JUnit test DayNightServiceTest.java for ensuring that Events are triggered from the DayNightService to

  • properly dispose orders at the end of the day.
  • trigger the transition cycle between the GameScreen, EndDayDisplay, and MoralDisplay

and to ensure DayNightService properly handles incoming event triggers when moral decisions have been made and animations are done.

What wasn't tested:

Although we set up the the displays and other components and files to appropriately handle the day cycle, we do not take ownership that those dependencies (MainGameOrderTicketDisplay.java, EndDayDisplay.java, MoralDecisionDisplay.java, PlayerStatsDisplay, and more) aer working properly, or at least not in this test. We ensure that our service is properly consuming incoming events and trigger events for transitions at the right time.

In Game Testing and Visual Confirmation:

It is easy to test and visually confirm that DayNightService is properly handling its role:

  1. In DayNightService.java adjust the five minutes condition to 10 seconds or so.
  2. Remove the handling of the "endGame" event imposed by team 6 to end that game at the end of the first day.
  3. Visually confirm that the game automatically transitions to the EndDayDisplay after 10 seconds.
  4. Visually confirm that you transition to MoralDecisionDisplay when you close EndDayDisplay.
  5. Visually confirm that you transition back to the MainGameScreen when you close MoralDecisionDisplay.
  6. Visually see how the day and timer information updates in the MainGameScreen.

Setup

There are 2 test methods. Since the instantiation of dependencies for the different tests vary and are a bit complex conceptually, I refrained from refactoring the test file with a setup method that runs before each test. Plus it doesn't make much sense when only 2 methods are involved.

Expected Outcome

Verifies that DayNightService successfully handles the event triggers and listeners to appropriately handle the day cycle transitions between the main game screen, end day display, moral decision display, and clear orders at the end of the day. It also ensure the "newday" event appropriately results in the day increments on the main game screen and displays a timer prior to the day ending.

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