Test Plan for 'AnimalSelectionActionsTest' - UQcsse3200/2024-studio-2 GitHub Wiki
Objective
To validate the functionality and correctness of the AnimalSelectionActions class, focusing on animal selection, navigation, and dialog display within the game.
Test Coverage
Initialization and Setup
Test Case: Ensure proper setup of mocks and dependencies.
Purpose: Confirm that all dependencies are correctly mocked and that the AnimalSelectionActions class is initialized properly with these mocks.
Verification:
- Validate that mockDisplay returns expected mock objects for images and buttons.
- Verify that AnimalSelectionActions is instantiated correctly with the mocked dependencies.
Animal Selection
Test Case: testSelectAnimal
Purpose: Validate that selecting an animal correctly highlights the image and updates the selected animal path.
Verification:
Ensure that the selected image is highlighted in red. Check that the selectedAnimalImagePath is updated to the expected value.
Additional Notes:
Confirm that the method handles different animal images and paths correctly. Back Button Functionality
Test Case: testBackButtonClick
Purpose: Verify that clicking the back button transitions the game to the main menu.
Verification:
- Ensure that a ClickListener is added to the back button.
- Confirm that clicking the button invokes the transition to the main menu screen in GdxGame.
Animal Dialog Display
Test Case: testShowAnimalDialog
Purpose: Ensure that the dialog for the selected animal displays the correct title, content, and image.
Verification:
- Verify that displayDialog is called with the correct title, content, image path, width, and height.
- Check that the values match the expected title, content, and dimensions.