use of com.instructure.canvasapi2.models.ToDo in project instructure-android by instructure.
the class TodoListRecyclerAdapterTest method testAreContentsTheSame_SameTitleFromSchedule.
@Test
public void testAreContentsTheSame_SameTitleFromSchedule() {
ToDo item = new ToDo();
ScheduleItem scheduleItem = new ScheduleItem();
scheduleItem.setTitle("item");
item.setScheduleItem(scheduleItem);
assertTrue(mAdapter.createItemCallback().areContentsTheSame(item, item));
}
use of com.instructure.canvasapi2.models.ToDo 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));
}
use of com.instructure.canvasapi2.models.ToDo in project instructure-android by instructure.
the class QuizManager_Test method getQuizQuestions.
public static void getQuizQuestions(long courseId, long quizId, StatusCallback<List<QuizQuestion>> callback) {
// TODO:
Response response = new Response.Builder().code(200).message("todo").protocol(Protocol.HTTP_1_0).body(ResponseBody.create(MediaType.parse("application/json"), "todo".getBytes())).addHeader("content-type", "application/json").build();
List<QuizQuestion> quizQuestions = new ArrayList<>();
retrofit2.Response<List<QuizQuestion>> response1 = retrofit2.Response.success(quizQuestions, response);
callback.onResponse(response1, new LinkHeaders(), ApiType.CACHE);
}
use of com.instructure.canvasapi2.models.ToDo in project instructure-android by instructure.
the class QuizManager_Test method getQuizesQuestions.
public static void getQuizesQuestions(StatusCallback<List<Quiz>> callback) {
// TODO:
Response response = new Response.Builder().code(200).message("todo").protocol(Protocol.HTTP_1_0).body(ResponseBody.create(MediaType.parse("application/json"), "todo".getBytes())).addHeader("content-type", "application/json").build();
List<Quiz> quizzes = new ArrayList<>();
Quiz quiz = new Quiz();
quiz.setTitle("TEST");
quiz.setDescription("description");
quizzes.add(quiz);
retrofit2.Response<List<Quiz>> response1 = retrofit2.Response.success(quizzes, response);
callback.onResponse(response1, new LinkHeaders(), ApiType.CACHE);
}
use of com.instructure.canvasapi2.models.ToDo in project instructure-android by instructure.
the class QuizManager_Test method getQuizSubmissionQuestions.
public static void getQuizSubmissionQuestions(long quizSubmissionId, StatusCallback<QuizSubmissionQuestionResponse> callback) {
// TODO:
Response response = new Response.Builder().code(200).message("todo").protocol(Protocol.HTTP_1_0).body(ResponseBody.create(MediaType.parse("application/json"), "todo".getBytes())).addHeader("content-type", "application/json").build();
QuizSubmissionQuestionResponse quizSubmissionQuestionResponse = new QuizSubmissionQuestionResponse();
List<QuizSubmissionQuestion> quizQuestions = new ArrayList<>();
QuizSubmissionQuestion question = new QuizSubmissionQuestion();
question.setQuestionText("TEST");
question.setQuestionType("essay_question");
quizQuestions.add(question);
quizSubmissionQuestionResponse.setQuizSubmissionQuestions(quizQuestions);
retrofit2.Response<QuizSubmissionQuestionResponse> response1 = retrofit2.Response.success(quizSubmissionQuestionResponse, response);
callback.onResponse(response1, new LinkHeaders(), ApiType.CACHE);
}
Aggregations