Пример #1
0
 @Test
 public void testDeleteOfSingleMessage() {
   Mailbox mailbox = new Mailbox(data) {};
   assertEquals(1, data.size());
   mailbox.delete(2);
   assertEquals(0, data.size());
 }
Пример #2
0
 @Test
 public void testDeleteOfMissingMessageCausesException() {
   Mailbox mailbox = new Mailbox(data) {};
   try {
     mailbox.delete(22222);
   } catch (Exception e) {
     assertEquals("no such message ID", e.getMessage());
   }
 }