ResourcesPerDay.amount(2)), equalTo(hours(1)));
}
@Test
public void asDurationOnRespectsCapacityExtraEffort() {
BaseCalendar calendar = createBasicCalendar();
addExceptionOn(calendar, MONDAY_LOCAL_DATE, Capacity.create(hours(2))
.withAllowedExtraEffort(hours(3)));
assertThat(calendar.asDurationOn(
PartialDay.wholeDay(MONDAY_LOCAL_DATE),
ResourcesPerDay.amount(1)), equalTo(hours(2)));
assertThat(calendar.asDurationOn(
PartialDay.wholeDay(MONDAY_LOCAL_DATE),
ResourcesPerDay.amount(2)), equalTo(hours(4)));
assertThat(calendar.asDurationOn(
PartialDay.wholeDay(MONDAY_LOCAL_DATE),
ResourcesPerDay.amount(3)), equalTo(hours(5)));
}