Test Plan for AnimalRouletteDisplay - UQcsse3200/2024-studio-2 GitHub Wiki
Objective
To validate the functionality and correctness of the AnimalRouletteDisplay
component class, ensuring that it correctly cycles between the different animals when left and right buttons are pressed.
Test Coverage
-
Default animal is dog
- Test Case:
defaultAnimalShouldBeDog()
- Purpose: Verify that by default the dog is selected
Steps:
- Check that the selected animal image and index is for the dog
Verification:
- Check
getSelectedAnimal()
andgetCurrentAnimalIndex()
methods
- Test Case:
-
Clicking left button cycles anti-clockwise through animals
- Test Case:
leftButtonShouldCycleACW()
- Purpose: Verify that clicking the left button scrolls through the animals anti-clockwise.
Steps:
- Fire an input
touchDown
event on the left button - Check that the selected animal image and index is for the bird
- Fire another input
touchDown
event on the left button - Check that the selected animal image and index is for the croc
- Fire one last input
touchDown
event on the left button - Check that the selected animal image and index has reset back to the dog
Verification:
- Check
getSelectedAnimal()
andgetCurrentAnimalIndex()
methods
- Test Case:
-
Clicking right button cycles clockwise through animals
- Test Case:
rightButtonShouldCycleCW()
- Purpose: Verify that clicking the right button scrolls through the animals clockwise.
Steps:
- Fire an input
touchDown
event on the right button - Check that the selected animal image and index is for the croc
- Fire another input
touchDown
event on the right button - Check that the selected animal image and index is for the bird
- Fire one last input
touchDown
event on the right button - Check that the selected animal image and index has reset back to the dog
Verification:
- Check
getSelectedAnimal()
andgetCurrentAnimalIndex()
methods
- Test Case: