-
Notifications
You must be signed in to change notification settings - Fork 0
Test Plan for `CameraZoomComponentTest`
falgonn edited this page Aug 28, 2024
·
1 revision
To validate the functionality and correctness of the CameraZoomComponent
class, ensuring that it handles zooming in and out correctly based on user input and adheres to zoom constraints.
-
Camera Zooms In on Scroll Up
-
Test Case:
shouldZoomCameraInOnScrollUp
- Purpose: Verify that the camera zooms in when the mouse wheel is scrolled up.
Steps:
- Create an entity with
CameraComponent
andCameraZoomComponent
. - Set the camera's initial position and resize it.
- Scroll the mouse wheel up.
- Verify that the camera zooms in (i.e., the viewport width and height decrease).
- Ensure the camera position and aspect ratio remain unchanged.
Verification:
- Check that the viewport width and height have decreased.
- Verify that the camera’s position and aspect ratio have not changed.
-
Test Case:
-
Camera Zooms Out on Scroll Down
-
Test Case:
shouldZoomCameraOutOnScrollDown
- Purpose: Verify that the camera zooms out when the mouse wheel is scrolled down.
Steps:
- Create an entity with
CameraComponent
andCameraZoomComponent
. - Set the camera's initial position and resize it.
- Scroll the mouse wheel down.
- Verify that the camera zooms out (i.e., the viewport width and height increase).
- Ensure the camera position and aspect ratio remain unchanged.
Verification:
- Check that the viewport width and height have increased.
- Verify that the camera’s position and aspect ratio have not changed.
-
Test Case:
-
Camera Zoom Constrained by Maximum Bound
-
Test Case:
shouldConstrainZoomOut
- Purpose: Verify that the camera zooming out is constrained by a maximum zoom amount.
Steps:
- Create an entity with
CameraComponent
andCameraZoomComponent
. - Continuously scroll the mouse wheel down to zoom out.
- Verify that the camera's zoom does not exceed the maximum bound.
Verification:
- Ensure that the viewport width and height do not exceed the maximum zoom amount.
- Confirm that zooming out stops when the maximum zoom amount is reached.
-
Test Case:
-
Camera Zoom Constrained by Minimum Bound
-
Test Case:
shouldConstrainZoomIn
- Purpose: Verify that the camera zooming in is constrained by a minimum zoom amount.
Steps:
- Create an entity with
CameraComponent
andCameraZoomComponent
. - Continuously scroll the mouse wheel up to zoom in.
- Verify that the camera's zoom does not go below the minimum bound.
Verification:
- Ensure that the viewport width and height do not fall below the minimum zoom amount.
- Confirm that zooming in stops when the minimum zoom amount is reached.
-
Test Case: