Search in sources :

Example 66 with Account

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

the class NotificationIdsTest method getCertificateErrorNotificationId_forIncomingServerWithDefaultAccount.

@Test
public void getCertificateErrorNotificationId_forIncomingServerWithDefaultAccount() throws Exception {
    Account account = createMockAccountWithAccountNumber(0);
    int notificationId = NotificationIds.getCertificateErrorNotificationId(account, INCOMING);
    assertEquals(1, notificationId);
}
Also used : Account(com.fsck.k9.Account) Test(org.junit.Test)

Example 67 with Account

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

the class NotificationIdsTest method getNewMailSummaryNotificationId_withSecondAccount.

@Test
public void getNewMailSummaryNotificationId_withSecondAccount() throws Exception {
    Account account = createMockAccountWithAccountNumber(1);
    int notificationId = NotificationIds.getNewMailSummaryNotificationId(account);
    assertEquals(21, notificationId);
}
Also used : Account(com.fsck.k9.Account) Test(org.junit.Test)

Example 68 with Account

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

the class NotificationIdsTest method getNewMailStackedNotificationId_withTooLowIndex.

@Test(expected = IndexOutOfBoundsException.class)
public void getNewMailStackedNotificationId_withTooLowIndex() throws Exception {
    Account account = createMockAccountWithAccountNumber(0);
    NotificationIds.getNewMailStackedNotificationId(account, -1);
}
Also used : Account(com.fsck.k9.Account) Test(org.junit.Test)

Example 69 with Account

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

the class NotificationIdsTest method createMockAccountWithAccountNumber.

private Account createMockAccountWithAccountNumber(int accountNumber) {
    Account account = mock(Account.class);
    when(account.getAccountNumber()).thenReturn(accountNumber);
    return account;
}
Also used : Account(com.fsck.k9.Account)

Example 70 with Account

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

the class NotificationIdsTest method getNewMailStackedNotificationId_withDefaultAccount.

@Test
public void getNewMailStackedNotificationId_withDefaultAccount() throws Exception {
    Account account = createMockAccountWithAccountNumber(0);
    int notificationIndex = 0;
    int notificationId = NotificationIds.getNewMailStackedNotificationId(account, notificationIndex);
    assertEquals(7, notificationId);
}
Also used : Account(com.fsck.k9.Account) Test(org.junit.Test)

Aggregations

Account (com.fsck.k9.Account)122 Test (org.junit.Test)81 MessagingException (com.fsck.k9.mail.MessagingException)53 LocalFolder (com.fsck.k9.mailstore.LocalFolder)44 LocalMessage (com.fsck.k9.mailstore.LocalMessage)43 LocalStore (com.fsck.k9.mailstore.LocalStore)42 ArrayList (java.util.ArrayList)34 MessageReference (com.fsck.k9.activity.MessageReference)32 Message (com.fsck.k9.mail.Message)29 Folder (com.fsck.k9.mail.Folder)27 UnavailableStorageException (com.fsck.k9.mailstore.UnavailableStorageException)25 MimeMessage (com.fsck.k9.mail.internet.MimeMessage)22 IOException (java.io.IOException)22 Cursor (android.database.Cursor)21 CertificateValidationException (com.fsck.k9.mail.CertificateValidationException)20 Store (com.fsck.k9.mail.Store)20 SearchAccount (com.fsck.k9.search.SearchAccount)20 PendingIntent (android.app.PendingIntent)19 Pop3Store (com.fsck.k9.mail.store.pop3.Pop3Store)19 AuthenticationFailedException (com.fsck.k9.mail.AuthenticationFailedException)18