diff --git a/k9mail/src/test/java/com/fsck/k9/account/AccountCreatorTest.java b/k9mail/src/test/java/com/fsck/k9/account/AccountCreatorTest.java index 5c67ae0e3..293eab532 100644 --- a/k9mail/src/test/java/com/fsck/k9/account/AccountCreatorTest.java +++ b/k9mail/src/test/java/com/fsck/k9/account/AccountCreatorTest.java @@ -32,6 +32,11 @@ public class AccountCreatorTest { assertEquals(DeletePolicy.ON_DELETE, result); } + @Test(expected= IllegalStateException.class) + public void getDefualtDeletePolicy_withSMTP_shouldFail(){ + AccountCreator.getDefaultDeletePolicy(Type.SMTP); + } + @Test public void getDefaultPort_withNoConnectionSecurityAndImap_shouldReturnDefaultPort() { int result = AccountCreator.getDefaultPort(ConnectionSecurity.NONE, Type.IMAP); diff --git a/k9mail/src/test/java/com/fsck/k9/helper/UtilityTest.java b/k9mail/src/test/java/com/fsck/k9/helper/UtilityTest.java index efc88aaa5..33eb3eeaa 100644 --- a/k9mail/src/test/java/com/fsck/k9/helper/UtilityTest.java +++ b/k9mail/src/test/java/com/fsck/k9/helper/UtilityTest.java @@ -4,6 +4,8 @@ package com.fsck.k9.helper; import org.junit.Test; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; public class UtilityTest { @@ -41,4 +43,38 @@ public class UtilityTest { assertEquals("TestTest", result); } + + @Test + public void arrayContains_withObject_ReturnsTrue(){ + Object[] container = {10,20,30,40,50,60,71,80,90,91}; + Object value = 10; + boolean result = Utility.arrayContains(container, value); + + assertTrue(result); + } + + @Test + public void arrayContains_withoutObject_ReturnsFalse(){ + Object[] container = {10,20,30,40,50,60,71,80,90,91}; + Object value = 11; + boolean result = Utility.arrayContains(container, value); + + assertFalse(result); + } + + @Test + public void arrayContainsAny_withObject_ReturnsTrue(){ + Object[] container = {10,20,30,40,50,60,71,80,90,91}; + boolean result = Utility.arrayContainsAny(container, 1, 2, 3, 10); + + assertTrue(result); + } + + @Test + public void arrayContainsAny_withoutObject_ReturnsFalse(){ + Object[] container = {10,20,30,40,50,60,71,80,90,91}; + boolean result = Utility.arrayContainsAny(container, 1, 2, 3, 4); + + assertFalse(result); + } }