use of com.instructure.canvasapi2.models.DiscussionEntry in project instructure-android by instructure.
the class DiscussionTopicHeaderTest method convertToDiscussionEntryTest_Description.
@Test
public void convertToDiscussionEntryTest_Description() throws Exception {
String localized_graded = "Graded discussion";
DiscussionTopicHeader header = new DiscussionTopicHeader();
Assignment assignment = new Assignment();
header.setAssignment(assignment);
DiscussionEntry entry = header.convertToDiscussionEntry(localized_graded, "points");
assertEquals(localized_graded, entry.getDescription());
}
use of com.instructure.canvasapi2.models.DiscussionEntry in project instructure-android by instructure.
the class DiscussionTopicHeaderTest method convertToDiscussionEntryTest_ParentID.
@Test
public void convertToDiscussionEntryTest_ParentID() throws Exception {
DiscussionTopicHeader header = new DiscussionTopicHeader();
DiscussionEntry entry = header.convertToDiscussionEntry("grade", "points");
assertEquals(-1, entry.getParentId());
}
use of com.instructure.canvasapi2.models.DiscussionEntry in project instructure-android by instructure.
the class DiscussionTopicHeaderTest method convertToDiscussionEntryTest_NullParent.
@Test
public void convertToDiscussionEntryTest_NullParent() throws Exception {
DiscussionTopicHeader header = new DiscussionTopicHeader();
DiscussionEntry entry = header.convertToDiscussionEntry("grade", "points");
assertEquals(null, entry.getParent());
}
use of com.instructure.canvasapi2.models.DiscussionEntry in project instructure-android by instructure.
the class DiscussionManager method updateDiscussionEntry.
public static void updateDiscussionEntry(CanvasContext canvasContext, long topicId, long entryId, DiscussionEntryPostBody updatedEntry, StatusCallback<DiscussionEntry> callback) {
if (isTesting() || mTesting) {
// TODO:
} else {
RestBuilder adapter = new RestBuilder(callback);
RestParams params = new RestParams.Builder().build();
DiscussionAPI.updateDiscussionEntry(adapter, canvasContext, topicId, entryId, updatedEntry, callback, params);
}
}
use of com.instructure.canvasapi2.models.DiscussionEntry in project instructure-android by instructure.
the class DiscussionManager method postToDiscussionTopic.
public static void postToDiscussionTopic(CanvasContext canvasContext, long topicId, String message, File attachment, String mimeType, StatusCallback<DiscussionEntry> callback) {
if (isTesting() || mTesting) {
// TODO:
} else {
RestBuilder adapter = new RestBuilder(callback);
RestParams params = new RestParams.Builder().build();
DiscussionAPI.postToDiscussionTopicWithAttachment(adapter, canvasContext, topicId, message, attachment, mimeType, callback, params);
}
}
Aggregations