Skip to content

GameMap Test Instances

HunterWhitty edited this page Oct 3, 2023 · 41 revisions

Some methods have been introduced to help create test GameMap instances for use in JUnit testing (to get that sweet code coverage). An additional method has also been included to load an alternate map into the SpaceGameArea class during player testing. The methods introduced for JUnit testing do not create a TerrainComponent to render the terrain since that would only add unnecessary complications. An example of how to create a test instance for JUnit testing will be shown below.

Creating your own maps for testing

Store test maps in assets/configs/TestMaps/, file paths should read "configs/TestMaps/[map name].txt" when being passed to methods <--- need to improve.

Loading in a different map into the SpaceGameArea

s

[image]

[image]

(https://github.com/UQcsse3200/2023-studio-1/blob/900b08f6de2e4ef922da957e313b73f8fe056fe9/assets/wiki/Map_System/SpaceGameAreaLoadedWithTestMap.png)

JUnit testing with the GameMap class

s

Clone this wiki locally