public void GetSchedulesByFacilityAndStartDateQueryHandler_WhenQueriedForAWeeklyScheduleWithAnInvalidDate_ReturnsNoRecords() { // arrange using (var context = new ScaScheduleContext()) { var handler = new GetSchedulesByFacilityAndStartDateQueryHandler(context); var query = new GetSchedulesByFacilityAndStartDateQuery { FacilityId = 1, StartDate = new DateTime(2017, 1, 1) }; // act var actual = handler.Handle(query); // assert Assert.IsFalse(actual.Any()); } }
public void GetSchedulesByFacilityAndStartDateQueryHandler_WhenCalledWithAValidDate_Returns10Records() { // arrange using (var context = new ScaScheduleContext()) { var handler = new GetSchedulesByFacilityAndStartDateQueryHandler(context); var query = new GetSchedulesByFacilityAndStartDateQuery { FacilityId = 1, StartDate = new DateTime(2018, 1, 1) }; // act var actual = handler.Handle(query); // assert Assert.AreEqual(actual.ToList().Count, 10); } }