Search in sources :

Example 36 with Course

use of com.instructure.canvasapi2.models.Course in project instructure-android by instructure.

the class CanvasContextTest method getContextId_TestCourse.

// endregion
// region getContextId
@Test
public void getContextId_TestCourse() {
    Course course = new Course();
    course.setId(1234);
    assertEquals("course_1234", course.getContextId());
}
Also used : Course(com.instructure.canvasapi2.models.Course) Test(org.junit.Test)

Example 37 with Course

use of com.instructure.canvasapi2.models.Course in project instructure-android by instructure.

the class CanvasContextTest method getGenericContext_TestCourse.

@Test
public void getGenericContext_TestCourse() {
    long id = 1234;
    String name = "hodor";
    Course course = new Course();
    course.setId(id);
    course.setName(name);
    assertEquals(true, course.equals(CanvasContext.getGenericContext(CanvasContext.Type.COURSE, id, name)));
}
Also used : Course(com.instructure.canvasapi2.models.Course) Test(org.junit.Test)

Example 38 with Course

use of com.instructure.canvasapi2.models.Course in project instructure-android by instructure.

the class CanvasContextTest method getHomePageID_TestHomeModules.

@Test
public void getHomePageID_TestHomeModules() {
    Course course = new Course();
    course.setHomePage(CanvasContext.HOME_MODULES);
    assertEquals(Tab.MODULES_ID, course.getHomePageID());
}
Also used : Course(com.instructure.canvasapi2.models.Course) Test(org.junit.Test)

Example 39 with Course

use of com.instructure.canvasapi2.models.Course in project instructure-android by instructure.

the class CanvasContextTest method toAPIString_TestCourse.

@Test
public void toAPIString_TestCourse() {
    Course course = new Course();
    course.setId(1234);
    assertEquals("/courses/1234", course.toAPIString());
}
Also used : Course(com.instructure.canvasapi2.models.Course) Test(org.junit.Test)

Example 40 with Course

use of com.instructure.canvasapi2.models.Course in project instructure-android by instructure.

the class CanvasContextTest method getSecondaryName_TestCourse.

// endregion
@Test
public void getSecondaryName_TestCourse() {
    Course course = new Course();
    String courseCode = "Hodor";
    course.setCourseCode(courseCode);
    assertEquals(courseCode, course.getSecondaryName());
}
Also used : Course(com.instructure.canvasapi2.models.Course) Test(org.junit.Test)

Aggregations

Course (com.instructure.canvasapi2.models.Course)106 Test (org.junit.Test)70 ArrayList (java.util.ArrayList)39 Enrollment (com.instructure.canvasapi2.models.Enrollment)29 RestBuilder (com.instructure.canvasapi2.builders.RestBuilder)17 RestParams (com.instructure.canvasapi2.builders.RestParams)17 View (android.view.View)13 Bundle (android.os.Bundle)10 TextView (android.widget.TextView)10 NonNull (android.support.annotation.NonNull)8 AdapterView (android.widget.AdapterView)8 ModuleItem (com.instructure.canvasapi2.models.ModuleItem)8 ParentFragment (com.instructure.candroid.fragment.ParentFragment)7 CanvasContext (com.instructure.canvasapi2.models.CanvasContext)7 ImageView (android.widget.ImageView)6 LinkHeaders (com.instructure.canvasapi2.utils.LinkHeaders)6 List (java.util.List)6 BindView (butterknife.BindView)5 RecyclerView (android.support.v7.widget.RecyclerView)4 StatusCallback (com.instructure.canvasapi2.StatusCallback)4