Search in sources :

Example 41 with Course

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

the class CanvasContextTest method canCreateDiscussions_TestTrue.

// endregion
@Test
public void canCreateDiscussions_TestTrue() {
    Course course = new Course();
    CanvasContextPermission canvasContextPermission = new CanvasContextPermission();
    canvasContextPermission.setCanCreateDiscussionTopic(true);
    course.setPermissions(canvasContextPermission);
    assertEquals(true, course.canCreateDiscussion());
}
Also used : Course(com.instructure.canvasapi2.models.Course) CanvasContextPermission(com.instructure.canvasapi2.models.CanvasContextPermission) Test(org.junit.Test)

Example 42 with Course

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

the class CanvasContextTest method equals_TestTrue.

@Test
public void equals_TestTrue() {
    Course course1 = new Course();
    Course course2 = new Course();
    assertEquals(true, course1.equals(course2));
}
Also used : Course(com.instructure.canvasapi2.models.Course) Test(org.junit.Test)

Example 43 with Course

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

the class CanvasContextTest method getHomePageID_TestNull.

// region getHomePageID
@Test
public void getHomePageID_TestNull() {
    Course course = new Course();
    course.setHomePage(null);
    assertEquals(Tab.NOTIFICATIONS_ID, course.getHomePageID());
}
Also used : Course(com.instructure.canvasapi2.models.Course) Test(org.junit.Test)

Example 44 with Course

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

the class CanvasContextTest method typeIsSection_TestFalse.

@Test
public void typeIsSection_TestFalse() {
    Course course = new Course();
    assertEquals(false, CanvasContext.Type.isSection(course));
}
Also used : Course(com.instructure.canvasapi2.models.Course) Test(org.junit.Test)

Example 45 with Course

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

the class CourseTest method getLicense_empty.

@Test
public void getLicense_empty() {
    Course course = new Course();
    course.setLicense("");
    assertEquals(Course.LICENSE.PRIVATE_COPYRIGHTED, course.getLicense());
}
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