use of com.instructure.candroid.fragment.ParentFragment in project instructure-android by instructure.
the class ModuleUtilityTest method testGetFragment_subheader.
@Test
public void testGetFragment_subheader() {
ModuleItem moduleItem = new ModuleItem();
moduleItem.setType("SubHeader");
Course course = new Course();
ParentFragment parentFragment = callGetFragment(moduleItem, course, null);
assertNull(parentFragment);
}
use of com.instructure.candroid.fragment.ParentFragment in project instructure-android by instructure.
the class ModuleUtilityTest method testGetFragment_assignment.
@Test
public void testGetFragment_assignment() {
String url = "https://mobile.canvas.net/api/v1/courses/222/assignments/123456789";
ModuleItem moduleItem = new ModuleItem();
moduleItem.setType("Assignment");
moduleItem.setId(4567);
moduleItem.setUrl(url);
Course course = new Course();
Bundle expectedBundle = new Bundle();
expectedBundle.putSerializable(Const.CANVAS_CONTEXT, course);
expectedBundle.putLong(Const.ASSIGNMENT_ID, 123456789);
ParentFragment parentFragment = callGetFragment(moduleItem, course, null);
assertNotNull(parentFragment);
assertEquals(AssignmentFragment.class, parentFragment.getClass());
assertEquals(expectedBundle.toString(), parentFragment.getArguments().toString());
}
use of com.instructure.candroid.fragment.ParentFragment in project instructure-android by instructure.
the class ModuleUtilityTest method testGetFragment_discussion.
@Test
public void testGetFragment_discussion() {
String url = "https://mobile.canvas.net/api/v1/courses/222/discussion_topics/123456789";
ModuleItem moduleItem = new ModuleItem();
moduleItem.setType("Discussion");
moduleItem.setId(4567);
moduleItem.setUrl(url);
Course course = new Course();
Bundle expectedBundle = new Bundle();
expectedBundle.putSerializable(Const.CANVAS_CONTEXT, course);
expectedBundle.putLong(Const.TOPIC_ID, 123456789);
expectedBundle.putBoolean(Const.ANNOUNCEMENT, false);
ParentFragment parentFragment = callGetFragment(moduleItem, course, null);
assertNotNull(parentFragment);
assertEquals(DiscussionDetailsFragment.class, parentFragment.getClass());
assertEquals(expectedBundle.toString(), parentFragment.getArguments().toString());
}
Aggregations