Search in sources :

Example 21 with Assignment

use of com.instructure.canvasapi2.models.Assignment in project instructure-android by instructure.

the class GradesListRecyclerAdapterTest method testAreContentsTheSame_SameWithSubmissionNullGrade.

@Test
public void testAreContentsTheSame_SameWithSubmissionNullGrade() {
    Assignment assignment1 = new Assignment();
    assignment1.setName("assignment");
    assignment1.setPointsPossible(0.0);
    Submission submission1 = new Submission();
    submission1.setGrade("A");
    assignment1.setSubmission(submission1);
    Assignment assignment2 = new Assignment();
    assignment2.setName("assignment1");
    assignment2.setPointsPossible(0.0);
    Submission submission2 = new Submission();
    submission1.setGrade(null);
    assignment1.setSubmission(submission2);
    assertFalse(mAdapter.createItemCallback().areContentsTheSame(assignment1, assignment2));
}
Also used : Assignment(com.instructure.canvasapi2.models.Assignment) Submission(com.instructure.canvasapi2.models.Submission) Test(org.junit.Test)

Example 22 with Assignment

use of com.instructure.canvasapi2.models.Assignment in project instructure-android by instructure.

the class GradesListRecyclerAdapterTest method testAreContentsTheSame_SameNameAndPoints.

@Test
public void testAreContentsTheSame_SameNameAndPoints() {
    Assignment assignment = new Assignment();
    assignment.setName("assignment");
    assignment.setPointsPossible(0.0);
    assertTrue(mAdapter.createItemCallback().areContentsTheSame(assignment, assignment));
}
Also used : Assignment(com.instructure.canvasapi2.models.Assignment) Test(org.junit.Test)

Example 23 with Assignment

use of com.instructure.canvasapi2.models.Assignment in project instructure-android by instructure.

the class GradesListRecyclerAdapterTest method testAreContentsTheSame_SameWithSubmissionNullChange.

@Test
public void testAreContentsTheSame_SameWithSubmissionNullChange() {
    Assignment assignment1 = new Assignment();
    assignment1.setName("assignment");
    assignment1.setPointsPossible(0.0);
    Submission submission1 = new Submission();
    submission1.setGrade("A");
    assignment1.setSubmission(submission1);
    Assignment assignment2 = new Assignment();
    assignment2.setName("assignment1");
    assignment2.setPointsPossible(0.0);
    assignment2.setSubmission(null);
    assertFalse(mAdapter.createItemCallback().areContentsTheSame(assignment1, assignment2));
}
Also used : Assignment(com.instructure.canvasapi2.models.Assignment) Submission(com.instructure.canvasapi2.models.Submission) Test(org.junit.Test)

Example 24 with Assignment

use of com.instructure.canvasapi2.models.Assignment in project instructure-android by instructure.

the class GradesListRecyclerAdapterTest method testAreContentsTheSame_DifferentScore.

@Test
public void testAreContentsTheSame_DifferentScore() {
    Assignment assignment1 = new Assignment();
    assignment1.setName("assignment1");
    assignment1.setPointsPossible(0.0);
    Assignment assignment2 = new Assignment();
    assignment2.setName("assignment1");
    assignment2.setPointsPossible(1.0);
    assertFalse(mAdapter.createItemCallback().areContentsTheSame(assignment1, assignment2));
}
Also used : Assignment(com.instructure.canvasapi2.models.Assignment) Test(org.junit.Test)

Example 25 with Assignment

use of com.instructure.canvasapi2.models.Assignment in project instructure-android by instructure.

the class TodoListRecyclerAdapterTest method testAreContentsTheSame_DifferentTitleFromAssignment.

@Test
public void testAreContentsTheSame_DifferentTitleFromAssignment() {
    ToDo item = new ToDo();
    Assignment assignment = new Assignment();
    assignment.setName("item");
    item.setAssignment(assignment);
    ToDo item1 = new ToDo();
    Assignment assignment1 = new Assignment();
    assignment1.setName("item1");
    item1.setAssignment(assignment1);
    assertFalse(mAdapter.createItemCallback().areContentsTheSame(item, item1));
}
Also used : Assignment(com.instructure.canvasapi2.models.Assignment) ToDo(com.instructure.canvasapi2.models.ToDo) Test(org.junit.Test)

Aggregations

Assignment (com.instructure.canvasapi2.models.Assignment)62 Test (org.junit.Test)46 Submission (com.instructure.canvasapi2.models.Submission)25 Date (java.util.Date)18 ArrayList (java.util.ArrayList)15 View (android.view.View)10 RestBuilder (com.instructure.canvasapi2.builders.RestBuilder)10 Course (com.instructure.canvasapi2.models.Course)9 RestParams (com.instructure.canvasapi2.builders.RestParams)7 Bundle (android.os.Bundle)6 ScheduleItem (com.instructure.canvasapi2.models.ScheduleItem)6 LinkHeaders (com.instructure.canvasapi2.utils.LinkHeaders)6 Navigation (com.instructure.interactions.Navigation)5 DrawableRes (android.support.annotation.DrawableRes)4 AdapterView (android.widget.AdapterView)4 TextView (android.widget.TextView)4 Request (okhttp3.Request)4 Response (okhttp3.Response)4 Paint (android.graphics.Paint)3 Drawable (android.graphics.drawable.Drawable)3