use of org.edx.mobile.model.api.SyncLastAccessedSubsectionResponse in project edx-app-android by edx.
the class ApiTests method testSyncLastSubsection.
// TODO: Debug and fix test failure
@Ignore
@Test
public void testSyncLastSubsection() throws Exception {
login();
EnrolledCoursesResponse e = executeStrict(courseAPI.getEnrolledCourses()).get(0);
Map<String, SectionEntry> map = courseAPI.getCourseHierarchy(e.getCourse().getId());
Entry<String, SectionEntry> entry = map.entrySet().iterator().next();
Entry<String, ArrayList<VideoResponseModel>> subsection = entry.getValue().sections.entrySet().iterator().next();
String courseId = e.getCourse().getId();
String lastVisitedModuleId = subsection.getValue().get(0).getSection().getId();
assertNotNull(courseId);
assertNotNull(lastVisitedModuleId);
print(String.format("course= %s ; sub-section= %s", courseId, lastVisitedModuleId));
// TODO: lastVisitedModuleId must be section.id (id is now available)
SyncLastAccessedSubsectionResponse model = executeStrict(courseAPI.syncLastAccessedSubsection(courseId, lastVisitedModuleId));
assertNotNull(model);
print("sync returned: " + model.last_visited_module_id);
}
use of org.edx.mobile.model.api.SyncLastAccessedSubsectionResponse in project edx-app-android by edx.
the class ApiTests method testGetLastAccessedModule.
// TODO: Debug and fix test failure
@Ignore
@Test
public void testGetLastAccessedModule() throws Exception {
login();
EnrolledCoursesResponse e = executeStrict(courseAPI.getEnrolledCourses()).get(0);
String courseId = e.getCourse().getId();
assertNotNull(courseId);
print(String.format("course= %s", courseId));
SyncLastAccessedSubsectionResponse model = executeStrict(courseAPI.getLastAccessedSubsection(courseId));
assertNotNull(model);
// print(model.json);
}
Aggregations