Skip to content

UGS Class Testing

JumpOffACliffy edited this page Oct 18, 2022 · 5 revisions

Feedback from Sprints 1-2

Based off of feedback received from sprints 1-2, the following ideas were integrated into the UGS:

  • Creating a unified grid positioning system which maintains the state of all entities and map layouts
  • Creating a snappable grid layout (i.e. if users click anywhere within a grid tile, the building is built in the centre of the tile)
  • Creating methods to allow easy utilisation of UGS features

Introduction

In accordance with the Test Plan tests were written for the UGS and the Tile classes.

Tests

UGSTest

Requirement Test case addressed by
Test a UGS can be correctly created shouldCreateUGS
Test a coordinate can be correctly generated shouldGenerateCoordinate
Tests that a Tile can be added to the UGS, and that the UGS returns correct result given a coordinate testReturnSmallHashmap
Tests a Tile within the UGS can be updated testSetTileType
Tests a Tile within the UGS can be updated to contain a new entity testSetEntity
Tests the UGS returns the correct tileType given it contains multiple tiles testReturnMultipleTiles
Tests the return value of the UGS is independent of the input testReturnGeneratedTiles
Tests the UGS can be updated with a large entity TestSetLargeEntity
Tests an entity can be returned by coordinate testGetEntity
Tests an entity can be returned by string testGetNamedEntity
Tests an entity can be removed from the UGS testRemoveEntity

TileTest

Requirement Test case addressed by
Test the no-parameter constructor works correctly testConstructorNoParams
Test the constructor which only takes an entity works correctly testConstructorEntity
Test the constructor which only takes a tileType works correctly testConstructorTileType
Test the setters work correctly testSetters

Future Updates

In the future, the team will need to expand upon tests for all classes to ensure test coverage is as high as possible.

Table of Contents

Home

How to Play

Introduction

Game Features

Main Character

Enemies
The Final Boss

Landscape Objects

Shop
Inventory
Achievements
Camera

Crystal

Infrastructure

Audio

User Interfaces Across All Pages
Juicy UI
User Interfaces Buildings
Guidebook
[Resource Management](Resource-Management)
Map
Day and Night Cycle
Unified Grid System (UGS)
Polishing

Game Engine

Getting Started

Entities and Components

Service Locator

Loading Resources

Logging

Unit Testing

Debug Terminal

Input Handling

UI

Animations

Audio

AI

Physics

Game Screens and Areas

Terrain

Concurrency & Threading

Settings

Troubleshooting

MacOS Setup Guide

Clone this wiki locally