use of com.instructure.canvasapi2.models.Recipient in project instructure-android by instructure.
the class ChooseMessageRecipientRecyclerAdapterTest method testAreContentsTheSame_SameName.
@Test
public void testAreContentsTheSame_SameName() {
Recipient recipient = new Recipient("", "name", 0, 0, 0);
assertTrue(mAdapter.getItemCallback().areContentsTheSame(recipient, recipient));
}
use of com.instructure.canvasapi2.models.Recipient in project instructure-android by instructure.
the class RecipientManager_Test method getFirstPageRecipients.
public static void getFirstPageRecipients(String searchQuery, String context, StatusCallback<List<Recipient>> callback, RestBuilder adapter, RestParams params) {
// TODO:
Response response = new Response.Builder().code(200).message("todo").protocol(Protocol.HTTP_1_0).body(ResponseBody.create(MediaType.parse("application/json"), "todo".getBytes())).addHeader("content-type", "application/json").build();
List<Recipient> items = new ArrayList<>();
retrofit2.Response<List<Recipient>> response1 = retrofit2.Response.success(items, response);
callback.onResponse(response1, new LinkHeaders(), ApiType.CACHE);
}
use of com.instructure.canvasapi2.models.Recipient in project instructure-android by instructure.
the class RecipientTest method getIdAsLongTest_Null.
@Test
public void getIdAsLongTest_Null() throws Exception {
Recipient recipient = new Recipient();
recipient.setStringId("invalid_id");
assertEquals(0, recipient.getIdAsLong());
}
use of com.instructure.canvasapi2.models.Recipient in project instructure-android by instructure.
the class RecipientTest method getIdAsLongTest_Course.
@Test
public void getIdAsLongTest_Course() throws Exception {
Recipient recipient = new Recipient();
recipient.setStringId("course_456789");
assertEquals(456789, recipient.getIdAsLong());
}
use of com.instructure.canvasapi2.models.Recipient in project instructure-android by instructure.
the class RecipientTest method getRecipientTypeTest_Group.
@Test
public void getRecipientTypeTest_Group() throws Exception {
Recipient recipient = new Recipient();
recipient.setStringId("not_a_person");
recipient.setUserCount(2);
assertEquals(Recipient.Type.group, recipient.getRecipientType());
}
Aggregations