|
// For complete examples and data files, please go to https://github.com/aspose-tasks-cloud/aspose-tasks-cloud-java/ |
|
String localFileName = "Calenar_with_exception.mpp"; |
|
String remoteFileName = TestInitializer.UploadFile(localFileName); |
|
|
|
GetCalendarExceptionsRequest request = new GetCalendarExceptionsRequest(remoteFileName, 1, null, null); |
|
CalendarExceptionsResponse result = TestInitializer.tasksApi.getCalendarExceptions(request); |
|
assertNotNull(result); |
|
assertEquals(200, (int) result.getCode()); |
|
assertNotNull(result.getCalendarExceptions()); |
|
assertEquals(1, result.getCalendarExceptions().size()); |
|
CalendarException calendarException = result.getCalendarExceptions().get(0); |
|
assertTrue(calendarException.isDayWorking()); |
|
assertEquals(Arrays.asList(DayType.MONDAY), calendarException.getDaysOfWeek()); |
|
assertEquals(OffsetDateTime.of(2018, 2, 13, 0, 0, 0, 0, ZoneOffset.UTC), calendarException.getFromDate()); |
|
assertEquals(OffsetDateTime.of(2018, 4, 9, 23, 59, 0, 0, ZoneOffset.UTC), calendarException.getToDate()); |
|
assertEquals(Month.UNDEFINED, calendarException.getMonth()); |
|
assertEquals(MonthItemType.UNDEFINED, calendarException.getMonthItem()); |
|
assertEquals(MonthPosition.UNDEFINED, calendarException.getMonthPosition()); |
|
assertEquals(CalendarExceptionType.WEEKLY, calendarException.getType()); |
|
assertEquals(Integer.valueOf(8), calendarException.getOccurrences()); |
|
assertEquals(Integer.valueOf(1), calendarException.getPeriod()); |
|
assertEquals(2, calendarException.getWorkingTimes().size()); |
|
assertEquals(OffsetDateTime.of(1, 1, 1, 9, 0, 0, 0, ZoneOffset.UTC), calendarException.getWorkingTimes().get(0).getFromTime()); |
|
assertEquals(OffsetDateTime.of(1, 1, 1, 12, 34, 0, 0, ZoneOffset.UTC), calendarException.getWorkingTimes().get(0).getToTime()); |
|
assertEquals(OffsetDateTime.of(1, 1, 1, 15, 11, 0, 0, ZoneOffset.UTC), calendarException.getWorkingTimes().get(1).getFromTime()); |
|
assertEquals(OffsetDateTime.of(1, 1, 1, 17, 30, 0, 0, ZoneOffset.UTC), calendarException.getWorkingTimes().get(1).getToTime()); |