To create the unit test class, follow these steps:
- Create a new class and name it ConWHSVehicleGroupChangeTest. The suffix is important.
- In the code editor, change the declaration so that it extends SysTestCase.
- Next, we will need some constants for test cases that we either expect to succeed or fail; in this case, we will have the following:
const ConWHSVehicleGroupId groupId= '%VG01%'; const ConWHSVehicleId vehicleId ='%V001%'; const str notFound= '%ERROR%';
- The next part is to set up the test case, which is done by overriding the setUpTestCase method with the following code:
publicvoidsetUpTestCase() { super(); ConWHSVehicleGroupvehGroup; ttsbegin; vehGroup.initValue(); vehGroup.VehicleGroupId = groupId; vehGroup.insert(); ...