@Test public void testMailRollsOff() { MailMessage firstMessage = new MailMessageImpl(); firstMessage.appendBody("First Post!"); mailStore.addMessage(firstMessage); assertEquals("First Post!", mailStore.getMessage(0).getBody()); for (int i = 0; i < 100; i++) { addAMessage(); } assertEquals(100, mailStore.getEmailCount()); assertEquals("", mailStore.getMessage(0).getBody()); }
@Test public void testAddOneMessageLeavesOneMail() { addAMessage(); assertEquals(1, mailStore.getEmailCount()); }
@Test public void testNewMailStoreHasNoMail() { assertEquals(0, mailStore.getEmailCount()); }