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

  1. Default animal is dog

    • Test Case: defaultAnimalShouldBeDog()
    • Purpose: Verify that by default the dog is selected

    Steps:

    1. Check that the selected animal image and index is for the dog

    Verification:

    • Check getSelectedAnimal() and getCurrentAnimalIndex() methods

  1. 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:

    1. Fire an input touchDown event on the left button
    2. Check that the selected animal image and index is for the bird
    3. Fire another input touchDown event on the left button
    4. Check that the selected animal image and index is for the croc
    5. Fire one last input touchDown event on the left button
    6. Check that the selected animal image and index has reset back to the dog

    Verification:

    • Check getSelectedAnimal() and getCurrentAnimalIndex() methods

  1. Clicking right button cycles clockwise through animals

    • Test Case: rightButtonShouldCycleCW()
    • Purpose: Verify that clicking the right button scrolls through the animals clockwise.

    Steps:

    1. Fire an input touchDown event on the right button
    2. Check that the selected animal image and index is for the croc
    3. Fire another input touchDown event on the right button
    4. Check that the selected animal image and index is for the bird
    5. Fire one last input touchDown event on the right button
    6. Check that the selected animal image and index has reset back to the dog

    Verification:

    • Check getSelectedAnimal() and getCurrentAnimalIndex() methods