use of com.instructure.canvasapi2.models.User in project instructure-android by instructure.
the class CanvasContextTest method getContextId_TestUser.
@Test
public void getContextId_TestUser() {
User user = new User();
user.setId(1234);
assertEquals("user_1234", user.getContextId());
}
use of com.instructure.canvasapi2.models.User in project instructure-android by instructure.
the class CanvasContextTest method getGenericContext_TestUser.
// endregion
// region getGenericContext
@Test
public void getGenericContext_TestUser() {
long id = 1234;
String name = "hodor";
User user = new User(id);
user.setName(name);
assertEquals(true, user.equals(CanvasContext.getGenericContext(CanvasContext.Type.USER, id, name)));
}
use of com.instructure.canvasapi2.models.User in project instructure-android by instructure.
the class CanvasContextTest method fromContextCode_TestUser.
@Test
public void fromContextCode_TestUser() {
User user = new User();
user.setId(1234);
assertEquals(true, user.equals(CanvasContext.fromContextCode(user.getContextId())));
}
use of com.instructure.canvasapi2.models.User in project instructure-android by instructure.
the class CourseManager method getCourseStudents.
public static void getCourseStudents(long courseId, StatusCallback<List<User>> callback, boolean forceNetwork) {
if (isTesting() || mTesting) {
CourseManager_Test.getCourseStudents(courseId, callback);
} else {
RestBuilder adapter = new RestBuilder(callback);
RestParams params = new RestParams.Builder().withPerPageQueryParam(true).withShouldIgnoreToken(false).withForceReadFromNetwork(forceNetwork).build();
CourseAPI.getCourseStudents(courseId, adapter, callback, params);
}
}
use of com.instructure.canvasapi2.models.User in project instructure-android by instructure.
the class CourseManager method getCourseStudent.
public static void getCourseStudent(long courseId, long studentId, StatusCallback<User> callback, boolean forceNetwork) {
if (isTesting() || mTesting) {
CourseManager_Test.getCourseStudent(courseId, studentId, callback);
} else {
RestBuilder adapter = new RestBuilder(callback);
RestParams params = new RestParams.Builder().withPerPageQueryParam(true).withShouldIgnoreToken(false).withForceReadFromNetwork(forceNetwork).build();
CourseAPI.getCourseStudent(courseId, studentId, adapter, callback, params);
}
}
Aggregations