Loading k9mail/src/test/java/com/fsck/k9/crypto/OpenPgpApiHelperTest.java 0 → 100644 +38 −0 Original line number Diff line number Diff line package com.fsck.k9.crypto; import com.fsck.k9.Identity; import org.junit.Test; import org.junit.runner.RunWith; import org.robolectric.RobolectricTestRunner; import org.robolectric.annotation.Config; import static org.junit.Assert.assertEquals; @RunWith(RobolectricTestRunner.class) @Config(manifest = Config.NONE, sdk = 21) public class OpenPgpApiHelperTest { @Test public void buildUserId_withName_shouldCreateOpenPgpAccountName() { Identity identity = new Identity(); identity.setEmail("user@domain.com"); identity.setName("Name"); String result = OpenPgpApiHelper.buildUserId(identity); assertEquals("Name <user@domain.com>", result); } @Test public void buildUserId_withoutName_shouldCreateOpenPgpAccountName() { Identity identity = new Identity(); identity.setEmail("user@domain.com"); String result = OpenPgpApiHelper.buildUserId(identity); assertEquals("<user@domain.com>", result); } } Loading
k9mail/src/test/java/com/fsck/k9/crypto/OpenPgpApiHelperTest.java 0 → 100644 +38 −0 Original line number Diff line number Diff line package com.fsck.k9.crypto; import com.fsck.k9.Identity; import org.junit.Test; import org.junit.runner.RunWith; import org.robolectric.RobolectricTestRunner; import org.robolectric.annotation.Config; import static org.junit.Assert.assertEquals; @RunWith(RobolectricTestRunner.class) @Config(manifest = Config.NONE, sdk = 21) public class OpenPgpApiHelperTest { @Test public void buildUserId_withName_shouldCreateOpenPgpAccountName() { Identity identity = new Identity(); identity.setEmail("user@domain.com"); identity.setName("Name"); String result = OpenPgpApiHelper.buildUserId(identity); assertEquals("Name <user@domain.com>", result); } @Test public void buildUserId_withoutName_shouldCreateOpenPgpAccountName() { Identity identity = new Identity(); identity.setEmail("user@domain.com"); String result = OpenPgpApiHelper.buildUserId(identity); assertEquals("<user@domain.com>", result); } }