use of com.instructure.canvasapi2.models.DiscussionTopicHeader in project instructure-android by instructure.
the class DiscussionManager method getFirstPagePinnedDiscussions.
public static void getFirstPagePinnedDiscussions(@NonNull CanvasContext canvasContext, final boolean forceNetwork, StatusCallback<List<DiscussionTopicHeader>> callback) {
if (isTesting() || mTesting) {
// TODO:
} else {
RestBuilder adapter = new RestBuilder(callback);
RestParams params = new RestParams.Builder().withForceReadFromNetwork(forceNetwork).withPerPageQueryParam(true).build();
DiscussionAPI.getFirstPagePinnedDiscussions(canvasContext, adapter, callback, params);
}
}
use of com.instructure.canvasapi2.models.DiscussionTopicHeader in project instructure-android by instructure.
the class DiscussionTopicHeaderTest method getTypeTest_Threaded.
@Test
public void getTypeTest_Threaded() throws Exception {
DiscussionTopicHeader discussionTopicHeader = new DiscussionTopicHeader();
discussionTopicHeader.setDiscussionType("threaded");
assertEquals(DiscussionTopicHeader.DiscussionType.THREADED, discussionTopicHeader.getType());
}
use of com.instructure.canvasapi2.models.DiscussionTopicHeader in project instructure-android by instructure.
the class DiscussionTopicHeaderTest method convertToDiscussionEntryTest_Message.
@Test
public void convertToDiscussionEntryTest_Message() throws Exception {
String message = "here is a message";
DiscussionTopicHeader header = new DiscussionTopicHeader();
header.setMessage(message);
DiscussionEntry entry = header.convertToDiscussionEntry("graded", "points");
assertEquals(header.getMessage(), entry.getMessage());
}
use of com.instructure.canvasapi2.models.DiscussionTopicHeader in project instructure-android by instructure.
the class DiscussionTopicHeaderTest method getTypeTest_SideComment.
@Test
public void getTypeTest_SideComment() throws Exception {
DiscussionTopicHeader discussionTopicHeader = new DiscussionTopicHeader();
discussionTopicHeader.setDiscussionType("side_comment");
assertEquals(DiscussionTopicHeader.DiscussionType.SIDE_COMMENT, discussionTopicHeader.getType());
}
use of com.instructure.canvasapi2.models.DiscussionTopicHeader in project instructure-android by instructure.
the class AnnouncementManager_Test method getAnnouncements.
public static void getAnnouncements(CanvasContext canvasContext, StatusCallback<List<DiscussionTopicHeader>> 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<DiscussionTopicHeader> items = new ArrayList<>();
retrofit2.Response<List<DiscussionTopicHeader>> response1 = retrofit2.Response.success(items, response);
callback.onResponse(response1, new LinkHeaders(), ApiType.CACHE);
}
Aggregations