Search in sources :

Example 61 with Message

use of com.fsck.k9.mail.Message in project k-9 by k9mail.

the class UidReverseComparatorTest method compare_withTwoMessagesWithInvalidUid_shouldReturnZero.

@Test
public void compare_withTwoMessagesWithInvalidUid_shouldReturnZero() throws Exception {
    Message messageLeft = createMessageWithInvalidUid();
    Message messageRight = createMessageWithInvalidUid();
    int result = comparator.compare(messageLeft, messageRight);
    assertEquals("result must be 0 when both arguments are a message with an invalid UID", 0, result);
}
Also used : Message(com.fsck.k9.mail.Message) Test(org.junit.Test)

Example 62 with Message

use of com.fsck.k9.mail.Message in project k-9 by k9mail.

the class UidReverseComparatorTest method compare_withNullArgumentAndMessageWithNullUid_shouldReturnZero.

@Test
public void compare_withNullArgumentAndMessageWithNullUid_shouldReturnZero() throws Exception {
    Message messageLeft = null;
    Message messageRight = createMessageWithNullUid();
    int result = comparator.compare(messageLeft, messageRight);
    assertEquals("result must be 0 when both arguments are not a message with valid UID", 0, result);
}
Also used : Message(com.fsck.k9.mail.Message) Test(org.junit.Test)

Example 63 with Message

use of com.fsck.k9.mail.Message in project k-9 by k9mail.

the class UidReverseComparatorTest method compare_withRightNullArgument_shouldReturnNegative.

@Test
public void compare_withRightNullArgument_shouldReturnNegative() throws Exception {
    Message messageLeft = createMessageWithUid(1);
    Message messageRight = null;
    int result = comparator.compare(messageLeft, messageRight);
    assertTrue("result must be < 0 when right argument is null", result < 0);
}
Also used : Message(com.fsck.k9.mail.Message) Test(org.junit.Test)

Example 64 with Message

use of com.fsck.k9.mail.Message in project k-9 by k9mail.

the class UidReverseComparatorTest method compare_withNullArgumentAndMessageWithInvalidUid_shouldReturnZero.

@Test
public void compare_withNullArgumentAndMessageWithInvalidUid_shouldReturnZero() throws Exception {
    Message messageLeft = null;
    Message messageRight = createMessageWithInvalidUid();
    int result = comparator.compare(messageLeft, messageRight);
    assertEquals("result must be 0 when both arguments are not a message with valid UID", 0, result);
}
Also used : Message(com.fsck.k9.mail.Message) Test(org.junit.Test)

Example 65 with Message

use of com.fsck.k9.mail.Message in project k-9 by k9mail.

the class UidReverseComparatorTest method compare_withMessageWithNullUidAndNullArgument_shouldReturnZero.

@Test
public void compare_withMessageWithNullUidAndNullArgument_shouldReturnZero() throws Exception {
    Message messageLeft = createMessageWithNullUid();
    Message messageRight = null;
    int result = comparator.compare(messageLeft, messageRight);
    assertEquals("result must be 0 when both arguments are not a message with valid UID", 0, result);
}
Also used : Message(com.fsck.k9.mail.Message) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)127 Message (com.fsck.k9.mail.Message)111 MimeMessage (com.fsck.k9.mail.internet.MimeMessage)102 Part (com.fsck.k9.mail.Part)47 LocalMessage (com.fsck.k9.mailstore.LocalMessage)46 MessagingException (com.fsck.k9.mail.MessagingException)41 ArrayList (java.util.ArrayList)41 MimeBodyPart (com.fsck.k9.mail.internet.MimeBodyPart)33 BodyPart (com.fsck.k9.mail.BodyPart)32 Account (com.fsck.k9.Account)27 LocalFolder (com.fsck.k9.mailstore.LocalFolder)24 TextBody (com.fsck.k9.mail.internet.TextBody)23 IOException (java.io.IOException)22 Address (com.fsck.k9.mail.Address)21 LocalStore (com.fsck.k9.mailstore.LocalStore)21 Date (java.util.Date)20 MessageReference (com.fsck.k9.activity.MessageReference)16 MimeMultipart (com.fsck.k9.mail.internet.MimeMultipart)16 Folder (com.fsck.k9.mail.Folder)14 AuthenticationFailedException (com.fsck.k9.mail.AuthenticationFailedException)13