use of com.instructure.canvasapi.model.ScheduleItem in project instructure-android by instructure.
the class ScheduleItemUnitTest method testScheduleItemCalendar.
@Test
public void testScheduleItemCalendar() {
Gson gson = CanvasRestAdapter.getGSONParser();
ScheduleItem[] scheduleItems = gson.fromJson(scheduleItemCalendarJSON, ScheduleItem[].class);
assertNotNull(scheduleItems);
for (ScheduleItem scheduleItem : scheduleItems) {
assertNotNull(scheduleItem);
assertNotNull(scheduleItem.getStartDate());
assertNotNull(scheduleItem.getTitle());
assertNotNull(scheduleItem.getContextType());
assertNotNull(scheduleItem.getHtmlUrl());
assertTrue(scheduleItem.getId() > 0);
assertTrue(scheduleItem.getContextId() > 0);
}
}
use of com.instructure.canvasapi.model.ScheduleItem in project instructure-android by instructure.
the class CalenderEventUnitTest method testCalenderEventList.
@Test
public void testCalenderEventList() {
Gson gson = CanvasRestAdapter.getGSONParser();
ScheduleItem[] list = gson.fromJson(upcomingEventsJSON, ScheduleItem[].class);
assertNotNull(list);
ScheduleItem listScheduleItem = list[0];
if (listScheduleItem.isAllDay()) {
assertNotNull(listScheduleItem.getAllDayDate());
} else {
assertFalse(listScheduleItem.isAllDay());
assertNull(listScheduleItem.getAllDayDate());
}
assertTrue(listScheduleItem.getId() > 0);
assertNotNull(listScheduleItem.getStartDate());
assertNotNull(listScheduleItem.getEndDate());
assertNotNull(listScheduleItem.getLocationName());
assertNotNull(listScheduleItem.getTitle());
assertNotNull(listScheduleItem.getDescription());
assertNotNull(listScheduleItem.getLocationAddress());
}
use of com.instructure.canvasapi.model.ScheduleItem in project instructure-android by instructure.
the class CalenderEventUnitTest method testCalenderEvent.
@Test
public void testCalenderEvent() {
Gson gson = CanvasRestAdapter.getGSONParser();
ScheduleItem scheduleItem = gson.fromJson(calenderEventJSON, ScheduleItem.class);
assertNotNull(scheduleItem);
if (scheduleItem.isAllDay()) {
assertNotNull(scheduleItem.getAllDayDate());
} else {
assertFalse(scheduleItem.isAllDay());
assertNull(scheduleItem.getAllDayDate());
}
assertTrue(scheduleItem.getId() > 0);
assertNotNull(scheduleItem.getStartDate());
assertNotNull(scheduleItem.getEndDate());
assertNotNull(scheduleItem.getLocationName());
assertNotNull(scheduleItem.getTitle());
assertNotNull(scheduleItem.getDescription());
assertNotNull(scheduleItem.getLocationAddress());
}
use of com.instructure.canvasapi.model.ScheduleItem in project instructure-android by instructure.
the class ScheduleItemUnitTest method testScheduleItemAssignment.
@Test
public void testScheduleItemAssignment() {
Gson gson = CanvasRestAdapter.getGSONParser();
Assignment[] assignments = gson.fromJson(scheduleItemAssignmentJSON, Assignment[].class);
assertNotNull(assignments);
for (Assignment assignment : assignments) {
ScheduleItem scheduleItem = assignment.toScheduleItem();
assertNotNull(scheduleItem);
assertTrue(scheduleItem.getId() > 0);
assertNotNull(scheduleItem.getTitle());
assertNotNull(scheduleItem.getType());
}
}
Aggregations