1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-23 18:02:15 -05:00

Change names of test methods

This commit is contained in:
cketti 2015-02-23 02:22:10 +01:00
parent 8fbb3edd1c
commit 084e7a1687

View File

@ -10,7 +10,6 @@ import org.junit.runner.RunWith;
import static junit.framework.Assert.assertEquals; import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertFalse; import static junit.framework.Assert.assertFalse;
import static junit.framework.Assert.assertNotNull;
import static junit.framework.Assert.assertNull; import static junit.framework.Assert.assertNull;
import static junit.framework.Assert.assertTrue; import static junit.framework.Assert.assertTrue;
@ -22,7 +21,7 @@ public class MessageReferenceTest {
* FORWARDED a flag.) * FORWARDED a flag.)
*/ */
@Test @Test
public void testIdentityStringNoFlag() { public void checkIdentityStringFromMessageReferenceWithoutFlag() {
MessageReference mr = new MessageReference(); MessageReference mr = new MessageReference();
mr.accountUuid = "o hai!"; mr.accountUuid = "o hai!";
mr.folderName = "folder"; mr.folderName = "folder";
@ -35,7 +34,7 @@ public class MessageReferenceTest {
* Typically happens during replies. * Typically happens during replies.
*/ */
@Test @Test
public void testIdentityString() { public void checkIdentityStringFromMessageReferenceWithFlag() {
MessageReference mr = new MessageReference(); MessageReference mr = new MessageReference();
mr.accountUuid = "o hai!"; mr.accountUuid = "o hai!";
mr.folderName = "folder"; mr.folderName = "folder";
@ -46,7 +45,7 @@ public class MessageReferenceTest {
} }
@Test @Test
public void testParseIdentityStringNoFlag() throws MessagingException { public void parseIdentityStringWithoutFlag() throws MessagingException {
MessageReference mr = new MessageReference("!:byBoYWkh:Zm9sZGVy:MTAxMDEwMTA="); MessageReference mr = new MessageReference("!:byBoYWkh:Zm9sZGVy:MTAxMDEwMTA=");
assertEquals("o hai!", mr.accountUuid); assertEquals("o hai!", mr.accountUuid);
assertEquals("folder", mr.folderName); assertEquals("folder", mr.folderName);
@ -55,7 +54,7 @@ public class MessageReferenceTest {
} }
@Test @Test
public void testParseIdentityString() throws MessagingException { public void parseIdentityStringWithFlag() throws MessagingException {
MessageReference mr = new MessageReference("!:byBoYWkh:Zm9sZGVy:MTAxMDEwMTA=:ANSWERED"); MessageReference mr = new MessageReference("!:byBoYWkh:Zm9sZGVy:MTAxMDEwMTA=:ANSWERED");
assertEquals("o hai!", mr.accountUuid); assertEquals("o hai!", mr.accountUuid);
assertEquals("folder", mr.folderName); assertEquals("folder", mr.folderName);
@ -64,30 +63,24 @@ public class MessageReferenceTest {
} }
@Test @Test
public void testBadVersion() throws MessagingException { public void parseIdentityStringContainingBadVersionNumber() throws MessagingException {
MessageReference mr = new MessageReference("@:byBoYWkh:Zm9sZGVy:MTAxMDEwMTA=:ANSWERED"); MessageReference mr = new MessageReference("@:byBoYWkh:Zm9sZGVy:MTAxMDEwMTA=:ANSWERED");
assertNull(mr.accountUuid); assertNull(mr.accountUuid);
} }
@Test(expected = MessagingException.class) @Test(expected = MessagingException.class)
public void testNull() throws MessagingException { public void parseNullIdentityString() throws MessagingException {
new MessageReference(null); new MessageReference(null);
} }
@Test(expected = MessagingException.class) @Test(expected = MessagingException.class)
public void testCorruption() throws MessagingException { public void parseIdentityStringWithCorruptFlag() throws MessagingException {
MessageReference mr = new MessageReference("!:%^&%^*$&$by&(BYWkh:Zm9%^@sZGVy:MT-35#$AxMDEwMTA=:ANSWERED");
// No idea what this is going to generate, but it should be non-null.
assertNotNull(mr.accountUuid);
assertNotNull(mr.folderName);
assertNotNull(mr.uid);
// Corruption in the Flag should throw MessagingException. // Corruption in the Flag should throw MessagingException.
new MessageReference("!:%^&%^*$&$by&(BYWkh:Zm9%^@sZGVy:MT-35#$AxMDEwMTA=:ANSWE!RED"); new MessageReference("!:%^&%^*$&$by&(BYWkh:Zm9%^@sZGVy:MT-35#$AxMDEwMTA=:ANSWE!RED");
} }
@Test @Test
public void notAnInstanceOfMessageReferenceCantEquals() { public void equalsWithAnObjectShouldReturnFalse() {
// A MessageReference : // A MessageReference :
MessageReference m = new MessageReference(); MessageReference m = new MessageReference();
// And another Object : // And another Object :
@ -97,7 +90,7 @@ public class MessageReferenceTest {
} }
@Test @Test
public void sameMessageReferenceObjectsAreEquals() { public void equalsWithMessageReferenceContainingSameDataShouldReturnTrue() {
// First MessageReference : // First MessageReference :
MessageReference m1 = new MessageReference(); MessageReference m1 = new MessageReference();
m1.accountUuid = "acc1"; m1.accountUuid = "acc1";
@ -114,7 +107,7 @@ public class MessageReferenceTest {
} }
@Test @Test
public void messageReferenceWithAnotherAccountUuidDontEquals() { public void equalsWithMessageReferenceContainingDifferentAccountUuidShouldReturnFalse() {
// First MessageReference : // First MessageReference :
MessageReference m1 = new MessageReference(); MessageReference m1 = new MessageReference();
m1.accountUuid = "acc1"; m1.accountUuid = "acc1";
@ -127,7 +120,7 @@ public class MessageReferenceTest {
} }
@Test @Test
public void messageReferenceWithAnotherFolderNameDontEquals() { public void equalsWithMessageReferenceContainingDifferentFolderNameShouldReturnFalse() {
// First MessageReference : // First MessageReference :
MessageReference m1 = new MessageReference(); MessageReference m1 = new MessageReference();
m1.folderName = "folder1"; m1.folderName = "folder1";
@ -140,7 +133,7 @@ public class MessageReferenceTest {
} }
@Test @Test
public void messageReferenceWithAnotherUidDontEquals() { public void equalsWithMessageReferenceContainingDifferentUidShouldReturnFalse() {
// First MessageReference : // First MessageReference :
MessageReference m1 = new MessageReference(); MessageReference m1 = new MessageReference();
m1.uid = "uid1"; m1.uid = "uid1";