Skip to content

Instantly share code, notes, and snippets.

@mickle00
Created January 21, 2013 18:34
Show Gist options
  • Save mickle00/4588178 to your computer and use it in GitHub Desktop.
Save mickle00/4588178 to your computer and use it in GitHub Desktop.
public with sharing class BusinessHoursClass_Test{
static testMethod void holidayShouldNotIncludeBusinessHours(){
BusinessHours supportHours = BusinessHoursClass.getBusinessHoursMap().get('GSO Salesforce Support');
Time midnight = Time.newInstance(0,0,0,0);
Date startDate = Date.newInstance(2013,12,24);
DateTime pacificStartDateTime = DateTime.newInstance(startDate,midnight);
Date pacificStartDate = date.valueOf(pacificStartDateTime);
Date endDate = Date.newInstance(2013,12,25);
DateTime pacificEndDateTime = DateTime.newInstance(endDate, midnight);
Date pacificEndDate = Date.valueOf(pacificEndDateTime);
integer businessHours = BusinessHoursClass.hoursBetween(supportHours.id, pacificStartDate, pacificEndDate);
system.assertEquals(0, businessHours);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment