use of com.instructure.canvasapi.model.SubmissionComment in project instructure-android by instructure.
the class SubmissionCommentUnitTest method testSubmissionComment.
@Test
public void testSubmissionComment() {
Gson gson = CanvasRestAdapter.getGSONParser();
SubmissionComment submissionComment = gson.fromJson(submissionCommentJSON, SubmissionComment.class);
assertNotNull(submissionComment);
assertNotNull(submissionComment.getAuthor());
assertNotNull(submissionComment.getAuthorName());
assertNotNull(submissionComment.getComment());
assertNotNull(submissionComment.getCreatedAt());
assertTrue(submissionComment.getAuthor().getId() > 0);
}
use of com.instructure.canvasapi.model.SubmissionComment in project instructure-android by instructure.
the class SubmissionUnitTest method testSubmission.
@Test
public void testSubmission() {
Gson gson = CanvasRestAdapter.getGSONParser();
Submission submission = gson.fromJson(submissionJson, Submission.class);
assertNotNull(submission);
assertTrue(submission.getId() > 0);
assertNotNull(submission.getBody());
assertNotNull(submission.getGrade());
assertTrue(submission.getScore() > 0);
assertNotNull(submission.getPreviewUrl());
assertNotNull(submission.getSubmissionType());
assertNotNull(submission.getUrl());
assertNotNull(submission.getWorkflowState());
assertNotNull(submission.getComments());
SubmissionComment comment = submission.getComments().get(0);
isCommentValid(comment);
assertNotNull(submission.getAttachments());
Attachment attachment = submission.getAttachments().get(0);
isValidAttachment(attachment);
}
use of com.instructure.canvasapi.model.SubmissionComment in project instructure-android by instructure.
the class DocumentActivity method onSubmissionCommentsUpdated.
@Override
public void onSubmissionCommentsUpdated(Submission submission) {
if (mAdapter == null || mViewpager == null) {
return;
}
final ArrayList<SubmissionComment> comments = submission.getComments();
mSubmissionsList.get(mViewpager.getCurrentItem()).setComments(comments);
final BaseSubmissionView fragment = (BaseSubmissionView) mAdapter.getItem(mViewpager.getCurrentItem());
fragment.submission.setComments(comments);
}
Aggregations