public void GivenWithTodayIs(string date) { var dateTime = DateTime.Parse(date); _schedules .With(x => x.Start == dateTime && x.Start.Month == DateTime.Today.Month && x.Start.Year == DateTime.Today.Year); }
public void Fails_when_closing_hour_is_before_opening_hour() { _availabilities = _availabilities.With(x => x.OpeningTime = LocalTime.Noon) .With(x => x.ClosingTime = LocalTime.Noon.PlusHours(-2)); var result = PerformAction(); Assert.IsFalse(result.IsValid); }
private static async Task <IOperable <Notification> > AddDataQualityTreatmentEvents(IOperable <Notification> notificationsOperable, NtbsContext context) { var completedOutcome = await context.TreatmentOutcome.Where(t => t.TreatmentOutcomeId == 1).FirstOrDefaultAsync(); var notificationsOperableWithTreatmentEvents = notificationsOperable .With(n => n.TreatmentEvents = new List <TreatmentEvent> { new TreatmentEvent { TreatmentEventType = TreatmentEventType.TreatmentStart, EventDate = new DateTime(2017, 1, 1) }, new TreatmentEvent { TreatmentEventType = TreatmentEventType.TreatmentOutcome, EventDate = new DateTime(2017, 2, 1), TreatmentOutcomeId = completedOutcome.TreatmentOutcomeId, TreatmentOutcome = completedOutcome } }); return(notificationsOperableWithTreatmentEvents); }