### Question:
ICalendarConverter { @VisibleForTesting Long reminder(ICalendarEvent iCalendarEvent) { Long firstAlarmInSeconds = iCalendarEvent.firstAlarmInSeconds(); if (firstAlarmInSeconds != null && firstAlarmInSeconds <= 0) { return Duration.standardSeconds(Math.abs(firstAlarmInSeconds)).getStandardMinutes(); } return null; }  MSMeetingRequest convertToMSMeetingRequest(ICalendar icalendar);  }### Answer:
@Test public void reminderNull() { ICalendarEvent iCalendarEvent = EasyMock.createMock(ICalendarEvent.class); EasyMock.expect(iCalendarEvent.firstAlarmInSeconds()).andReturn(null).once(); EasyMock.replay(iCalendarEvent); Long reminder = icalendarConverter.reminder(iCalendarEvent); EasyMock.verify(iCalendarEvent); assertThat(reminder).isNull(); }
@Test public void reminderZero() { ICalendarEvent iCalendarEvent = EasyMock.createMock(ICalendarEvent.class); EasyMock.expect(iCalendarEvent.firstAlarmInSeconds()).andReturn(0l).once(); EasyMock.replay(iCalendarEvent); Long reminder = icalendarConverter.reminder(iCalendarEvent); EasyMock.verify(iCalendarEvent); assertThat(reminder).isEqualTo(0); }
@Test public void reminderBeforeStartDateGetsMinuteValue() { ICalendarEvent iCalendarEvent = EasyMock.createMock(ICalendarEvent.class); EasyMock.expect(iCalendarEvent.firstAlarmInSeconds()).andReturn(-600l).once(); EasyMock.replay(iCalendarEvent); Long reminder = icalendarConverter.reminder(iCalendarEvent); EasyMock.verify(iCalendarEvent); assertThat(reminder).isEqualTo(10); }
@Test public void reminderAfterStartDateGetsNullValue() { ICalendarEvent iCalendarEvent = EasyMock.createMock(ICalendarEvent.class); EasyMock.expect(iCalendarEvent.firstAlarmInSeconds()).andReturn(600l).once(); EasyMock.replay(iCalendarEvent); Long reminder = icalendarConverter.reminder(iCalendarEvent); EasyMock.verify(iCalendarEvent); assertThat(reminder).isNull(); }