mirror of
https://github.com/oxen-io/session-android.git
synced 2025-12-29 23:21:07 +00:00
Fix matches logic in contact selection.
This commit is contained in:
committed by
Greyson Parrelli
parent
fe25d941bb
commit
c5e7300df2
@@ -3,8 +3,8 @@ package org.thoughtcrime.securesms.contacts;
|
||||
import org.junit.Test;
|
||||
import org.thoughtcrime.securesms.recipients.RecipientId;
|
||||
|
||||
import static edu.emory.mathcs.backport.java.util.Collections.singletonList;
|
||||
import static java.util.Arrays.asList;
|
||||
import static java.util.Collections.singletonList;
|
||||
import static org.hamcrest.CoreMatchers.is;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
@@ -92,13 +92,13 @@ public final class SelectedContactSetTest {
|
||||
SelectedContact contact1 = SelectedContact.forPhone(RecipientId.from(1), "+1-555-000-0000");
|
||||
SelectedContact contact2 = SelectedContact.forUsername(RecipientId.from(2), "@alice");
|
||||
SelectedContact contact3 = SelectedContact.forUsername(null, "@bob");
|
||||
SelectedContact contact2Remove = SelectedContact.forUsername(RecipientId.from(1), "@alice");
|
||||
SelectedContact contact2Remove = SelectedContact.forUsername(RecipientId.from(1), "@bob");
|
||||
|
||||
assertTrue(selectedContactSet.add(contact1));
|
||||
assertTrue(selectedContactSet.add(contact2));
|
||||
assertTrue(selectedContactSet.add(contact3));
|
||||
assertEquals(2, selectedContactSet.remove(contact2Remove));
|
||||
|
||||
assertThat(selectedContactSet.getContacts(), is(singletonList(contact3)));
|
||||
assertThat(selectedContactSet.getContacts(), is(singletonList(contact2)));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user