Skip to content

Test Plan for Customer Sensor Component

bhavyamalik1 edited this page Oct 16, 2024 · 3 revisions

Test Environment

  • Framework: JUnit 4
  • _Objects Used: CustomerSensorComponent, InteractionComponent, Entity (mocked), CustomerComponent (mocked), Non-Customer Entity (mocked)

Test Cases - Testing CustomerSensorComponent Methods

  1. Customer Sensor Component Initialisation
    Purpose: To verify that the CustomerSensorComponent is properly initialised and its interaction component is correctly set up. Expected Results: CustomerSensorComponent, its InteractionComponent, and its fixture should not be null after creation. The fixture should be the same as the entity's created fixture.

  2. Entity Initialisation Purpose: To verify that the entity is correctly initialised with the InteractionComponent and that its fixture is properly configured. Expected Results: The fixture for the InteractionComponent should not be null. The fixture should be a part of the PLAYER physics layer.

  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: Before colliding with a customer, the closest customer object should be null. After colliding with a customer within range, there should be one value inside the collidingFixtures variable.

  5. Detecting Closest Customer Purpose: To verify that the closest customer is returned when calling getClosestCustomer(). Expected Results: After colliding with a customer, the closest customer object should not be null. The closest customer object should be the one that is physically closest to the player.

  6. Not Detecting Distant Customers Purpose: To verify that customers out of range are not added to the list and cannot be interacted with. Expected Results: After colliding with a customer who is out of range, the closest customer object should remain null.

  7. Not Detecting Non-Customer Entities Purpose: To ensure that only customer entities are detected and non-customer entities (e.g., other game objects or NPCs not marked as customers) are ignored by the sensor. Expected Results: After colliding with a non-customer entity, the closest customer object should remain null.

  8. Removing a Customer After Collision Ends Purpose: To verify that after the player moves out of range of a customer, the customer is removed from the list of colliding fixtures, and the player can no longer interact with them. Expected Results: After moving out of range of a previously detected customer, the closest customer object should be null.

  9. Handling Multiple Customers Purpose: To verify that when multiple customers are within range, the closest customer is always correctly identified and returned by the CustomerSensorComponent. Expected Results: After colliding with multiple customers, the closest customer object should always be the one closest to the player. Moving closer to a different customer should update the closest customer object accordingly.

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