@Test(expected = RuntimeException.class) public void attendeeWhoDoesntExistTriesToDecline() { fakeMeeting.setFrom("*****@*****.**"); fakeMeeting.setAttendees("*****@*****.**"); sm.setup(fakeMeeting); sm.setDeclined("*****@*****.**"); }
@Test public void twoAttendeesInvitedOneAcceptsOneDeclines() { fakeMeeting.setFrom("*****@*****.**"); fakeMeeting.setAttendees("[email protected]; [email protected]"); sm.setup(fakeMeeting); sm.setAccepted("*****@*****.**"); sm.setDeclined("*****@*****.**"); ArrayList<String> invited = (ArrayList<String>) sm.getUnAnsweredRecipients(); assertEquals(0, invited.size()); ArrayList<String> accepted = (ArrayList<String>) sm.getAcceptedRecipients(); assertEquals(2, accepted.size()); assertTrue("*****@*****.**".equals(accepted.get(0))); assertTrue("*****@*****.**".equals(accepted.get(1))); ArrayList<String> declined = (ArrayList<String>) sm.getDeclinedRecipients(); assertEquals(1, declined.size()); assertTrue("*****@*****.**".equals(declined.get(0))); }