This document outlines the test cases for validating the functionalities of the Motor Vehicle and Truck Management System.
- Description: Verify if a
MotorVehicle
object is created with the correct initial values. - Input: License Plate:
VVV-111
, Year:2010
- Expected Output:
| 2010 | VVV-111 | Factory
- Status: Pass
- Description: Check if the
MotorVehicle
correctly updates its location whenmoveTo
is called. - Input: Move Vehicle to
Downtown Toronto
- Expected Output:
| VVV-111| | Factory ---> Downtown Toronto |
- Status: Pass
- Description: Verify if a
Truck
object is created with the correct initial values, including capacity. - Input: License Plate:
T-1111
, Year:2015
, Capacity:5432
, Address:Toronto HQ
- Expected Output:
| 2015 | T-1111 | Toronto HQ | 0.0/5432
- Status: Pass
- Description: Ensure that
addCargo
adds weight correctly without exceeding capacity. - Input: Add Cargo:
2000
- Expected Output:
Cargo loaded! | 2015 | T-1111 | Toronto HQ | 2000.0/5432
- Status: Pass
- Description: Verify that the truck does not exceed its maximum capacity.
- Input: Add Cargo:
6000
- Expected Output:
Adding cargo failed! | 2015 | T-1111 | Toronto HQ | 5432.0/5432
- Status: Pass
- Description: Check if
unloadCargo
correctly empties the truck’s cargo. - Input: Unload Cargo
- Expected Output:
Cargo unloaded! | 2015 | T-1111 | Toronto HQ | 0.0/5432
- Status: Pass
- Description: Validate that incorrect inputs for license plate or capacity are handled gracefully.
- Input: License Plate:
123456789
(Exceeds 8 characters) - Expected Output: Error or truncated value.
- Status: Pass
- Description: Ensure user can interact with objects using
cin
andcout
. - Input: License Plate:
ABC-123
, Year:2020
, Address:Mississauga
- Expected Output:
| 2020 | ABC-123 | Mississauga
- Status: Pass
Feel free to expand or modify these test cases as needed. Ensure all edge cases and invalid inputs are properly tested.