use of com.instructure.canvasapi2.models.Assignment in project instructure-android by instructure.
the class CalendarListRecyclerAdapterTest method testAreContentsTheSame_differentAssignment.
@Test
public void testAreContentsTheSame_differentAssignment() {
ScheduleItem scheduleItem1 = new ScheduleItem();
scheduleItem1.setTitle("ScheduleItem1");
Date date = new Date();
scheduleItem1.setStartAt(date);
Assignment assignment1 = new Assignment();
assignment1.setDueAt(APIHelper.dateToString(new Date(Calendar.getInstance().getTimeInMillis() - 1000)));
scheduleItem1.setAssignment(assignment1);
ScheduleItem scheduleItem2 = new ScheduleItem();
scheduleItem2.setTitle("ScheduleItem1");
scheduleItem2.setStartAt(date);
Assignment assignment2 = new Assignment();
assignment2.setDueAt(APIHelper.dateToString(new Date(Calendar.getInstance().getTimeInMillis() + 1000)));
scheduleItem2.setAssignment(assignment2);
assertFalse(mAdapter.createItemCallback().areContentsTheSame(scheduleItem1, scheduleItem2));
}
use of com.instructure.canvasapi2.models.Assignment in project instructure-android by instructure.
the class CalendarListRecyclerAdapterTest method testAreContentsTheSame_nullAssignment.
@Test
public void testAreContentsTheSame_nullAssignment() {
ScheduleItem scheduleItem1 = new ScheduleItem();
scheduleItem1.setTitle("ScheduleItem1");
Date date = new Date();
scheduleItem1.setStartAt(date);
Assignment assignment1 = new Assignment();
assignment1.setDueAt(APIHelper.dateToString(date));
scheduleItem1.setAssignment(assignment1);
ScheduleItem scheduleItem2 = new ScheduleItem();
scheduleItem2.setTitle("ScheduleItem1");
scheduleItem2.setStartAt(date);
Assignment assignment2 = null;
scheduleItem2.setAssignment(assignment2);
assertFalse(mAdapter.createItemCallback().areContentsTheSame(scheduleItem1, scheduleItem2));
}
use of com.instructure.canvasapi2.models.Assignment in project instructure-android by instructure.
the class GradesListRecyclerAdapterTest method testAreContentsTheSame_DifferentName.
@Test
public void testAreContentsTheSame_DifferentName() {
Assignment assignment1 = new Assignment();
assignment1.setName("assignment1");
assignment1.setPointsPossible(0.0);
Assignment assignment2 = new Assignment();
assignment2.setName("assignment2");
assignment2.setPointsPossible(0.0);
assertFalse(mAdapter.createItemCallback().areContentsTheSame(assignment1, assignment2));
}
use of com.instructure.canvasapi2.models.Assignment in project instructure-android by instructure.
the class GradesListRecyclerAdapterTest method testAreContentsTheSame_SameWithSubmission.
@Test
public void testAreContentsTheSame_SameWithSubmission() {
Assignment assignment = new Assignment();
assignment.setName("assignment");
assignment.setPointsPossible(0.0);
Submission submission = new Submission();
submission.setGrade("A");
assignment.setSubmission(submission);
assertTrue(mAdapter.createItemCallback().areContentsTheSame(assignment, assignment));
}
use of com.instructure.canvasapi2.models.Assignment in project instructure-android by instructure.
the class TodoListRecyclerAdapterTest method testAreContentsTheSame_SameTitleFromAssignment.
@Test
public void testAreContentsTheSame_SameTitleFromAssignment() {
ToDo item = new ToDo();
Assignment assignment = new Assignment();
assignment.setName("item");
item.setAssignment(assignment);
assertTrue(mAdapter.createItemCallback().areContentsTheSame(item, item));
}
Aggregations