Exemplo n.º 1
0
  @Test
  public void hitContact() throws Exception {
    ContactAutoComplete.AutoCompleteResult result = new ContactAutoComplete.AutoCompleteResult(10);
    result.rankings = new ContactRankings(MockProvisioning.DEFAULT_ACCOUNT_ID);
    ContactAutoComplete.ContactEntry contact = new ContactAutoComplete.ContactEntry();
    contact.mDisplayName = "C1";
    contact.mEmail = "*****@*****.**";
    result.addEntry(contact);
    Assert.assertEquals(result.entries.size(), 1);

    contact = new ContactAutoComplete.ContactEntry();
    contact.mDisplayName = "C2";
    contact.mEmail = "*****@*****.**";
    result.addEntry(contact);
    Assert.assertEquals(result.entries.size(), 2);
  }
Exemplo n.º 2
0
  @Test
  public void hitGroup() throws Exception {
    ContactAutoComplete.AutoCompleteResult result = new ContactAutoComplete.AutoCompleteResult(10);
    result.rankings = new ContactRankings(MockProvisioning.DEFAULT_ACCOUNT_ID);
    ContactAutoComplete.ContactEntry group = new ContactAutoComplete.ContactEntry();
    group.mDisplayName = "G1";
    group.mIsContactGroup = true;
    result.addEntry(group);
    Assert.assertEquals(result.entries.size(), 1);

    group = new ContactAutoComplete.ContactEntry();
    group.mDisplayName = "G2";
    group.mIsContactGroup = true;
    result.addEntry(group);
    Assert.assertEquals(result.entries.size(), 2);
  }