Search in sources :

Example 26 with Group

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

the class CanvasContextTest method fromContextCode_TestGroup.

@Test
public void fromContextCode_TestGroup() {
    Group group = new Group();
    group.setId(1234);
    assertEquals(true, group.equals(CanvasContext.fromContextCode(group.getContextId())));
}
Also used : Group(com.instructure.canvasapi2.models.Group) Test(org.junit.Test)

Example 27 with Group

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

the class CanvasContextTest method getSecondaryName_TestGroup.

@Test
public void getSecondaryName_TestGroup() {
    Group group = new Group();
    String name = "Hodor";
    group.setName(name);
    assertEquals(name, group.getSecondaryName());
}
Also used : Group(com.instructure.canvasapi2.models.Group) Test(org.junit.Test)

Example 28 with Group

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

the class CanvasContextTest method getGenericContext_TestGroup.

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

Example 29 with Group

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

the class CanvasContextTest method typeIsGroup_TestTrue.

@Test
public void typeIsGroup_TestTrue() {
    Group group = new Group();
    assertEquals(true, CanvasContext.Type.isGroup(group));
}
Also used : Group(com.instructure.canvasapi2.models.Group) Test(org.junit.Test)

Example 30 with Group

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

the class CanvasContextTest method typeIsCourse_TestFalse.

@Test
public void typeIsCourse_TestFalse() {
    Group group = new Group();
    assertEquals(false, CanvasContext.Type.isCourse(group));
}
Also used : Group(com.instructure.canvasapi2.models.Group) Test(org.junit.Test)

Aggregations

Group (com.instructure.canvasapi2.models.Group)17 ArrayList (java.util.ArrayList)12 List (java.util.List)9 Test (org.junit.Test)9 NonNull (android.support.annotation.NonNull)8 RestBuilder (com.instructure.canvasapi2.builders.RestBuilder)8 RestParams (com.instructure.canvasapi2.builders.RestParams)8 Course (com.instructure.canvasapi2.models.Course)7 CanvasContext (com.instructure.canvasapi2.models.CanvasContext)6 StatusCallback (com.instructure.canvasapi2.StatusCallback)5 ExhaustiveListCallback (com.instructure.canvasapi2.utils.ExhaustiveListCallback)5 Bundle (android.os.Bundle)3 View (android.view.View)3 ModuleItem (com.instructure.canvasapi2.models.ModuleItem)3 ApiType (com.instructure.canvasapi2.utils.ApiType)3 LinkHeaders (com.instructure.canvasapi2.utils.LinkHeaders)3 Response (retrofit2.Response)3 RecyclerView (android.support.v7.widget.RecyclerView)2 ViewGroup (android.view.ViewGroup)2 AdapterView (android.widget.AdapterView)2