public void AvailableTimeSlotShouldBeGreaterThanEqualsToCurrentTime() { var now = DateTime.Now; var meetingCalendar = new Calendar(now.AddHours(-1), now.AddHours(1)); meetingCalendar.AddAttendees(new List <IAttendee>()); var firstAvailableTimeSlot = meetingCalendar.FindFirstAvailableSlot(10); Assert.That(firstAvailableTimeSlot.StartTime, Is.GreaterThanOrEqualTo(now.CalibrateToMinutes())); }
public void AddNewAttendeesToMeeting() { var meetingCalendar = new Calendar(DateTime.Now, DateTime.Now.AddDays(1)); meetingCalendar.AddAttendees(new List <IAttendee> { new Attendee("Person4", new List <IMeetingInfo> { new MeetingInfo(DateTime.Now.AddMinutes(5), DateTime.Now.AddMinutes(7)), new MeetingInfo(DateTime.Now.AddMinutes(12), DateTime.Now.AddMinutes(18)) }) }); Assert.That(meetingCalendar.Attendees.Count, Is.EqualTo(1)); Assert.That(meetingCalendar.Attendees.First().AttendeeName, Is.EqualTo("Person4")); }
public void AppendNullAttendeesToMeeting_Should_Not_Raise_Error() { var meetingCalendar = new Calendar(DateTime.Now, DateTime.Now.AddDays(1)); meetingCalendar.AddAttendees(new List <IAttendee> { new Attendee("Person4", new List <IMeetingInfo> { new MeetingInfo(DateTime.Now.AddMinutes(5), DateTime.Now.AddMinutes(7)), new MeetingInfo(DateTime.Now.AddMinutes(12), DateTime.Now.AddMinutes(18)) }) }); meetingCalendar.AppendAttendees(null); Assert.That(meetingCalendar.Attendees.Count, Is.EqualTo(1)); Assert.That(meetingCalendar.Attendees.First().AttendeeName, Is.EqualTo("Person4")); void AppendAttendees() => meetingCalendar.AppendAttendees(null); Assert.DoesNotThrow(AppendAttendees, "AppendAttendees threw exception."); }