mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-23 18:02:15 -05:00
use @Test(expected =
This commit is contained in:
parent
c79256684d
commit
9523a589fc
@ -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.assertNotNull;
|
import static junit.framework.Assert.assertNotNull;
|
||||||
import static junit.framework.Assert.assertNull;
|
import static junit.framework.Assert.assertNull;
|
||||||
import static junit.framework.Assert.assertTrue;
|
|
||||||
|
|
||||||
@RunWith(AndroidJUnit4.class)
|
@RunWith(AndroidJUnit4.class)
|
||||||
public class MessageReferenceTest
|
public class MessageReferenceTest
|
||||||
@ -71,20 +70,13 @@ public class MessageReferenceTest
|
|||||||
assertNull(mr.accountUuid);
|
assertNull(mr.accountUuid);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test(expected = MessagingException.class)
|
||||||
public void testNull() throws MessagingException
|
public void testNull() throws MessagingException
|
||||||
{
|
{
|
||||||
try
|
new MessageReference(null);
|
||||||
{
|
|
||||||
new MessageReference(null);
|
|
||||||
assertTrue(false);
|
|
||||||
} catch (MessagingException e)
|
|
||||||
{
|
|
||||||
assertTrue(true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test(expected = MessagingException.class)
|
||||||
public void testCorruption() throws MessagingException
|
public void testCorruption() throws MessagingException
|
||||||
{
|
{
|
||||||
MessageReference mr = new MessageReference("!:%^&%^*$&$by&(BYWkh:Zm9%^@sZGVy:MT-35#$AxMDEwMTA=:ANSWERED");
|
MessageReference mr = new MessageReference("!:%^&%^*$&$by&(BYWkh:Zm9%^@sZGVy:MT-35#$AxMDEwMTA=:ANSWERED");
|
||||||
@ -94,13 +86,6 @@ public class MessageReferenceTest
|
|||||||
assertNotNull(mr.uid);
|
assertNotNull(mr.uid);
|
||||||
|
|
||||||
// Corruption in the Flag should throw MessagingException.
|
// Corruption in the Flag should throw MessagingException.
|
||||||
try
|
new MessageReference("!:%^&%^*$&$by&(BYWkh:Zm9%^@sZGVy:MT-35#$AxMDEwMTA=:ANSWE!RED");
|
||||||
{
|
|
||||||
new MessageReference("!:%^&%^*$&$by&(BYWkh:Zm9%^@sZGVy:MT-35#$AxMDEwMTA=:ANSWE!RED");
|
|
||||||
assertTrue(false);
|
|
||||||
} catch (MessagingException e)
|
|
||||||
{
|
|
||||||
assertTrue(true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user