Skip to content

Instantly share code, notes, and snippets.

@shankybnl
Created June 6, 2018 18:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shankybnl/b1fcdd16f3092dbb0f21e4501cbc3526 to your computer and use it in GitHub Desktop.
Save shankybnl/b1fcdd16f3092dbb0f21e4501cbc3526 to your computer and use it in GitHub Desktop.
Test-driven development (TDD) example
@Test
public void verifyTimeDifferenceBetweenExpectedReportTimeAndActivityStartForNonPlacementVehicles() throws Throwable {
// increasing vehicle start time from current time by 2 hours
vehicleSteps.minutesShouldBeAddedOrDeletedToVehicleNodeTrackingId
(120, "added", 894440);
// end the duty for pilot 1435
pilotSteps.pilotIsOnDUTYOUT(1435L);
// end the duty for pilot 1448
pilotSteps.pilotIsOnDUTYOUT(1448L);
// end the duty for pilot 1422
pilotSteps.pilotIsOnDUTYOUT(1422L);
// execute auto allocation scheduler
commonSteps.executeAAScheduler();
// verify if pilot 1422 got assigned on vehicle HR55V1072
pilotSteps.verifyPilotActivityTablePilotShouldGetAssignedOnVehicleNodeTracking
(1422L, "HR55V1072", "be active");
// difference between expected report time and activity start should be 15 mins
pilotSteps.differenceBetweenExpectedReportTimeOfPilotAndActivityStartTimeOfVehicleShouldBeMinutes
(1422L, "HR55V1072", 15);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment