use of com.fsck.k9.mail.Address in project k-9 by k9mail.
the class MessageHelperTest method testToFriendlyWithChangeContactColor.
@Test
public void testToFriendlyWithChangeContactColor() throws Exception {
Address address = new Address("test@testor.com");
CharSequence friendly = MessageHelper.toFriendly(address, contactsWithFakeContact, true, true, Color.RED);
assertTrue(friendly instanceof SpannableString);
assertEquals("Tim Testor", friendly.toString());
}
use of com.fsck.k9.mail.Address in project k-9 by k9mail.
the class MessageHelperTest method testToFriendlyArray.
@Test
public void testToFriendlyArray() throws Exception {
Address address1 = new Address("test@testor.com", "Tim Testor");
Address address2 = new Address("foo@bar.com", "Foo Bar");
Address[] addresses = new Address[] { address1, address2 };
assertEquals("Tim Testor,Foo Bar", MessageHelper.toFriendly(addresses, contacts).toString());
}
use of com.fsck.k9.mail.Address in project k-9 by k9mail.
the class MessageHelperTest method testToFriendlyWithoutCorrespondentNames.
@Test
public void testToFriendlyWithoutCorrespondentNames() throws Exception {
Address address = new Address("test@testor.com", "Tim Testor");
CharSequence friendly = MessageHelper.toFriendly(address, contactsWithFakeContact, false, false, 0);
assertEquals("test@testor.com", friendly.toString());
}
use of com.fsck.k9.mail.Address in project k-9 by k9mail.
the class MessageHelperTest method toFriendly_spoofPreventionOverridesPersonal.
@Test
public void toFriendly_spoofPreventionOverridesPersonal() {
Address address = new Address("test@testor.com", "potus@whitehouse.gov");
CharSequence friendly = MessageHelper.toFriendly(address, contacts);
assertEquals("test@testor.com", friendly.toString());
}
use of com.fsck.k9.mail.Address in project k-9 by k9mail.
the class MessageHelperTest method toFriendly_spoofPreventionDoesntOverrideContact.
@Test
public void toFriendly_spoofPreventionDoesntOverrideContact() {
Address address = new Address("test@testor.com", "Tim Testor");
CharSequence friendly = MessageHelper.toFriendly(address, contactsWithFakeSpoofContact, true, false, 0);
assertEquals("Tim@Testor", friendly.toString());
}
Aggregations