fork download
  1. @isTest
  2. private class ServiceResourceScheduleHandlerImplTest {
  3. static testMethod void getUnavailableTimeslotsTest() {
  4.  
  5. //Initializing the test execution with mock values. Change it according to the implementation.
  6. //In case of non-test execution, the lxscheduler.ServiceAppointmentRequestInfo instance will automatically initialize.
  7.  
  8. //Mock values for lxscheduler.ServiceResourceInfo
  9. String userId = '005D2000000I1N6IAK';
  10. String userName = 'someuser@example.com';
  11. String email = 'someuser@example.com';
  12. String serviceResourceId = '0HnD20000004C9bKAE';
  13. List<String> territoryIds = new List<String>();
  14. String resourceType = 'T';
  15. lxscheduler.ServiceResourceInfo serviceResInfo = new lxscheduler.ServiceResourceInfo(userId, userName, email,
  16. serviceResourceId, territoryIds, resourceType);
  17.  
  18. //Mock values for lxscheduler.ServiceAppointmentRequestInfo
  19. DateTime startDate = System.now();
  20. DateTime endDate = System.now();
  21. List<lxscheduler.ServiceResourceInfo> serviceResources = new List<lxscheduler.ServiceResourceInfo>();
  22. serviceResources.add(serviceResInfo);
  23. String schedulingPolicyId = '0VrD20000004C9S';
  24. String workTypeGroupId = '0VSD20000004C93OAE';
  25. String accountId = '001D2000002pkXwIAI';
  26. String primaryResourceId = '0HnD20000004C9bKAE';
  27. String workTypeId = '08qD20000004C9XIAU';
  28. String correlationId = 'SOME_ID';
  29.  
  30. lxscheduler.ServiceAppointmentRequestInfo mockRequestInfo = new lxscheduler.ServiceAppointmentRequestInfo(startDate, endDate, serviceResources,
  31. schedulingPolicyId, workTypeGroupId, accountId,
  32. primaryResourceId, workTypeId, correlationId);
  33.  
  34. ServiceResourceScheduleHandlerImpl.getUnavailableTimeslots(mockRequestInfo);
  35. }
  36. }
Success #stdin #stdout #stderr 0.01s 7904KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
./prog:1: expected expression