Search in sources :

Example 71 with Account

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

the class NotificationIdsTest method getNewMailStackedNotificationId_withSecondAccount.

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

Example 72 with Account

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

the class NotificationIdsTest method getAuthenticationErrorNotificationId_forIncomingServerWithSecondAccount.

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

Example 73 with Account

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

the class NotificationIdsTest method getCertificateErrorNotificationId_forIncomingServerWithSecondAccount.

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

Example 74 with Account

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

the class NotificationIdsTest method getAuthenticationErrorNotificationId_forOutgoingServerWithDefaultAccount.

@Test
public void getAuthenticationErrorNotificationId_forOutgoingServerWithDefaultAccount() throws Exception {
    Account account = createMockAccountWithAccountNumber(0);
    int notificationId = NotificationIds.getAuthenticationErrorNotificationId(account, OUTGOING);
    assertEquals(4, notificationId);
}
Also used : Account(com.fsck.k9.Account) Test(org.junit.Test)

Example 75 with Account

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

the class SendFailedNotificationsTest method createFakeAccount.

private Account createFakeAccount() {
    Account account = mock(Account.class);
    when(account.getAccountNumber()).thenReturn(ACCOUNT_NUMBER);
    when(account.getDescription()).thenReturn(ACCOUNT_NAME);
    return account;
}
Also used : Account(com.fsck.k9.Account)

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