-
Notifications
You must be signed in to change notification settings - Fork 2
Testing Plan for DayNight cycle and JUnit Tests
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
, andMoralDisplay
and to ensure DayNightService
properly handles incoming event triggers when moral decisions have been made and animations are done.
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.
It is easy to test and visually confirm that DayNightService is properly handling its role:
- In
DayNightService.java
adjust the five minutes condition to 10 seconds or so. - Remove the handling of the "endGame" event imposed by team 6 to end that game at the end of the first day.
- Visually confirm that the game automatically transitions to the
EndDayDisplay
after 10 seconds. - Visually confirm that you transition to
MoralDecisionDisplay
when you closeEndDayDisplay
. - Visually confirm that you transition back to the
MainGameScreen
when you closeMoralDecisionDisplay
. - Visually see how the day and timer information updates in the
MainGameScreen
.
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.
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.
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
Entities and Components
Input Handling
Game Screens and Areas
Fire Extinguisher Handler Component
MainGameActions Create Docket Triggers
Main Game Order Button Display
BackstoryCutsceneDisplay Test Plan
Test Plan for MainGameOrderTicketDisplay
Test Plan for MainGameOrderBtnDisplay
Test Plan for DocketLineDisplay
Test plan for RandomComboService
Test plan for SpeedBoostUpgrade
Test plan for DancePartyUpgrade