public void MarkConflictingAppointmentsUponCreation() { // TODO: refactor once we have the refactored constructor var schedule = new Schedule(Guid.NewGuid(), testDateTimeRange, testClinicId); schedule.AddExistingAppointments(new List <Appointment>() { testAppointment1, testAppointment2 }); Assert.IsTrue(testAppointment1.IsPotentiallyConflicting); Assert.IsTrue(testAppointment2.IsPotentiallyConflicting); }
public void UnmarkConflictingAppointmentsUponTheirUpdate() { // Arrange var schedule = new Schedule(Guid.NewGuid(), testDateTimeRange, testClinicId); schedule.AddExistingAppointments(new List <Appointment>() { testAppointment1, testAppointment2 }); // Act - should raise an event Schedule should handle and unmark conflict testAppointment1.UpdateTime(new DateTimeRange(testAppointment1.TimeRange.Start.AddDays(1), testAppointment1.TimeRange.End.AddDays(1))); Assert.IsFalse(testAppointment1.IsPotentiallyConflicting); Assert.IsFalse(testAppointment2.IsPotentiallyConflicting); }