use of com.fsck.k9.helper.MailTo in project k-9 by k9mail.
the class MailToTest method testGetCc_singleEmailAddress.
@Test
public void testGetCc_singleEmailAddress() {
Uri uri = Uri.parse("mailto:test1@abc.com?cc=test3@abc.com");
MailTo mailToHelper = MailTo.parse(uri);
Address[] emailAddressList = mailToHelper.getCc();
assertEquals(emailAddressList[0].getAddress(), "test3@abc.com");
}
use of com.fsck.k9.helper.MailTo in project k-9 by k9mail.
the class MailToTest method testGetTo_multipleEmailAddress.
@Test
public void testGetTo_multipleEmailAddress() {
Uri uri = Uri.parse("mailto:test1@abc.com?to=test2@abc.com");
MailTo mailToHelper = MailTo.parse(uri);
Address[] emailAddressList = mailToHelper.getTo();
assertEquals(emailAddressList[0].getAddress(), "test1@abc.com");
assertEquals(emailAddressList[1].getAddress(), "test2@abc.com");
}
use of com.fsck.k9.helper.MailTo in project k-9 by k9mail.
the class MailToTest method testGetBcc_multipleEmailAddress.
@Test
public void testGetBcc_multipleEmailAddress() {
Uri uri = Uri.parse("mailto:?bcc=test3@abc.com&bcc=test4@abc.com");
MailTo mailToHelper = MailTo.parse(uri);
Address[] emailAddressList = mailToHelper.getBcc();
assertEquals(emailAddressList[0].getAddress(), "test3@abc.com");
assertEquals(emailAddressList[1].getAddress(), "test4@abc.com");
}
use of com.fsck.k9.helper.MailTo in project k-9 by k9mail.
the class ListHeadersTest method getListPostAddresses_withMailTo_shouldReturnCorrectAddress.
@Test
public void getListPostAddresses_withMailTo_shouldReturnCorrectAddress() throws Exception {
for (String emailAddress : TEST_EMAIL_ADDRESSES) {
String headerValue = "<mailto:" + emailAddress + ">";
Message message = buildMimeMessageWithListPostValue(headerValue);
Address[] result = ListHeaders.getListPostAddresses(message);
assertExtractedAddressMatchesEmail(emailAddress, result);
}
}
use of com.fsck.k9.helper.MailTo in project k-9 by k9mail.
the class ListHeadersTest method getListPostAddresses_withMailtoWithSubject_shouldReturnCorrectAddress.
@Test
public void getListPostAddresses_withMailtoWithSubject_shouldReturnCorrectAddress() throws Exception {
for (String emailAddress : TEST_EMAIL_ADDRESSES) {
String headerValue = "<mailto:" + emailAddress + "?subject=list%20posting>";
Message message = buildMimeMessageWithListPostValue(headerValue);
Address[] result = ListHeaders.getListPostAddresses(message);
assertExtractedAddressMatchesEmail(emailAddress, result);
}
}