use of com.fsck.k9.mail.Multipart in project k-9 by k9mail.
the class TextPartFinderTest method findFirstTextPart_withMultipartMixedContainingTextHtmlFirst.
@Test
public void findFirstTextPart_withMultipartMixedContainingTextHtmlFirst() throws Exception {
BodyPart expected = createTextPart("text/html");
Part part = createMultipart("multipart/mixed", expected, createTextPart("text/plain"));
Part result = textPartFinder.findFirstTextPart(part);
assertEquals(expected, result);
}
use of com.fsck.k9.mail.Multipart in project k-9 by k9mail.
the class TextPartFinderTest method findFirstTextPart_withMultipartAlternative.
@Test
public void findFirstTextPart_withMultipartAlternative() throws Exception {
BodyPart expected = createTextPart("text/plain");
Part part = createMultipart("multipart/alternative", expected, createTextPart("text/html"));
Part result = textPartFinder.findFirstTextPart(part);
assertEquals(expected, result);
}
use of com.fsck.k9.mail.Multipart in project k-9 by k9mail.
the class TextPartFinderTest method findFirstTextPart_withMultipartAlternativeContainingEmptyTextPlainPart.
@Test
public void findFirstTextPart_withMultipartAlternativeContainingEmptyTextPlainPart() throws Exception {
BodyPart expected = createEmptyPart("text/plain");
Part part = createMultipart("multipart/alternative", expected, createTextPart("text/html"));
Part result = textPartFinder.findFirstTextPart(part);
assertEquals(expected, result);
}
use of com.fsck.k9.mail.Multipart in project k-9 by k9mail.
the class TextPartFinderTest method findFirstTextPart_withMultipartMixedNotContainingTextPart.
@Test
public void findFirstTextPart_withMultipartMixedNotContainingTextPart() throws Exception {
Part part = createMultipart("multipart/mixed", createPart("image/jpeg"), createPart("image/gif"));
Part result = textPartFinder.findFirstTextPart(part);
assertNull(result);
}
use of com.fsck.k9.mail.Multipart in project k-9 by k9mail.
the class TextPartFinderTest method findFirstTextPart_withMultipartAlternativeContainingMultipartRelatedContainingTextPlain.
@Test
public void findFirstTextPart_withMultipartAlternativeContainingMultipartRelatedContainingTextPlain() throws Exception {
BodyPart expected = createTextPart("text/plain");
Part part = createMultipart("multipart/alternative", createMultipart("multipart/related", expected, createPart("image/jpeg")), createTextPart("text/html"));
Part result = textPartFinder.findFirstTextPart(part);
assertEquals(expected, result);
}
Aggregations