Test Plan for Companion Lab window - UQcsse3200/2023-studio-2 GitHub Wiki
Introduction
The LabWindow class is responsible for creating a laboratory window in the game where players can interact with various potions and perform actions. This test plan outlines test scenarios to ensure that the LabWindow class functions correctly and displays potion images as expected.
Mock Stages
stage (
Mock): Simulates the game stage.
potionStage
(Mock): Simulates the stage for potion images.
Test Steps
- Create a new instance of LabWindow.
LabWindow labWindow = LabWindow.MakeNewLaboratory();
stage.addActor(labWindow);
- Add potion images to the potionStage.
addPotionImagesToStage(potionStage);
- Simulate a rendering cycle for the game.
Gdx.graphics.getGL20().glClearColor(0, 0, 0, 0);
Gdx.graphics.getGL20().glClear(GL20.GL_COLOR_BUFFER_BIT);
- Render the potion images on the potionStage
potionStage.act(Gdx.graphics.getDeltaTime());
potionStage.draw();
- Assert that potion images are present on the potionStage using their actor names.
assertNotNull(potionStage.getRoot().findActor("DeathPotionImage"));
assertNotNull(potionStage.getRoot().findActor("SpeedPotionImage"));
Conclusion
This test plan verifies the creation of the LabWindow and the presence of potion images on the stage. It ensures that the LabWindow functions correctly and displays potion images as expected in the game.