use of com.instructure.canvasapi2.models.Recipient in project instructure-android by instructure.
the class ChooseMessageRecipientRecyclerAdapterTest method testAreContentsTheSame_DifferentName.
@Test
public void testAreContentsTheSame_DifferentName() {
Recipient recipient1 = new Recipient("", "name", 0, 0, 0);
Recipient recipient2 = new Recipient("", "hodor", 0, 0, 0);
assertFalse(mAdapter.getItemCallback().areContentsTheSame(recipient1, recipient2));
}
use of com.instructure.canvasapi2.models.Recipient in project instructure-android by instructure.
the class RecipientManager method searchAllRecipients.
public static void searchAllRecipients(final boolean forceNetwork, String searchQuery, String context, StatusCallback<List<Recipient>> callback) {
if (isTesting() || mTesting) {
// TODO...
} else {
final RestBuilder adapter = new RestBuilder(callback);
StatusCallback<List<Recipient>> depaginatedCallback = new ExhaustiveListCallback<Recipient>(callback) {
@Override
public void getNextPage(@NonNull StatusCallback<List<Recipient>> callback, @NonNull String nextUrl, boolean isCached) {
RecipientAPI.getNextPageRecipients(forceNetwork, nextUrl, adapter, callback);
}
};
adapter.setStatusCallback(depaginatedCallback);
RecipientAPI.getFirstPageRecipients(forceNetwork, searchQuery, context, adapter, depaginatedCallback);
}
}
use of com.instructure.canvasapi2.models.Recipient in project instructure-android by instructure.
the class RecipientTest method getRecipientTypeTest_Person.
@Test
public void getRecipientTypeTest_Person() throws Exception {
Recipient recipient = new Recipient();
recipient.setStringId("1234567");
assertEquals(Recipient.Type.person, recipient.getRecipientType());
}
use of com.instructure.canvasapi2.models.Recipient in project instructure-android by instructure.
the class RecipientTest method getIdAsLongTest_Number.
@Test
public void getIdAsLongTest_Number() throws Exception {
Recipient recipient = new Recipient();
recipient.setStringId("123456789");
assertEquals(123456789, recipient.getIdAsLong());
}
use of com.instructure.canvasapi2.models.Recipient in project instructure-android by instructure.
the class RecipientTest method getRecipientTypeTest_MetaGroup.
@Test
public void getRecipientTypeTest_MetaGroup() throws Exception {
Recipient recipient = new Recipient();
recipient.setStringId("not_a_person_or_group");
recipient.setUserCount(0);
assertEquals(Recipient.Type.metagroup, recipient.getRecipientType());
}
Aggregations