ItEr23S08CUEdicionCalendarioLaboral: Added specific test to check that exceptions are associated with the valid calendar in that moment.
This commit is contained in:
parent
2019046855
commit
0be1d61529
1 changed files with 22 additions and 0 deletions
|
|
@ -566,4 +566,26 @@ public class BaseCalendarTest {
|
|||
equalTo(fridayHours));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testExceptionsInDifferentVersions() {
|
||||
BaseCalendar calendar = createBasicCalendar();
|
||||
BaseCalendar newVersion = calendar.newVersion(WEDNESDAY_LOCAL_DATE);
|
||||
|
||||
newVersion.addExceptionDay(ExceptionDay.create(MONDAY_LOCAL_DATE, 0));
|
||||
newVersion.addExceptionDay(ExceptionDay.create(FRIDAY_LOCAL_DATE, 0));
|
||||
|
||||
Integer mondayHours = newVersion.getWorkableHours(MONDAY_LOCAL_DATE);
|
||||
assertThat(mondayHours, equalTo(0));
|
||||
assertThat(calendar.getWorkableHours(MONDAY_LOCAL_DATE),
|
||||
equalTo(mondayHours));
|
||||
|
||||
Integer fridayHours = newVersion.getWorkableHours(FRIDAY_LOCAL_DATE);
|
||||
assertThat(fridayHours, equalTo(0));
|
||||
assertThat(calendar.getWorkableHours(FRIDAY_LOCAL_DATE),
|
||||
equalTo(fridayHours));
|
||||
|
||||
assertThat(calendar.getOwnExceptions().size(), equalTo(1));
|
||||
assertThat(newVersion.getOwnExceptions().size(), equalTo(1));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue