public void ShouldReturnTrueIfSunriseDateIsWithinTheToAndFromDates() { _dateNow.Setup(o => o.Now()).Returns(new DateTime(2016, 12, 10)); var isWithin = _comparer.SunriseDateIsBetweenStartAndEndDates(new DateTime(2016, 8, 5), new DateTime(2016, 8, 1), new DateTime(2016, 8, 31)); isWithin.Should().BeTrue(); }
private bool CheckDates(DateTime?startDate, DateTime?endDate, News news) { return(startDate.HasValue && endDate.HasValue ? _dateComparer.SunriseDateIsBetweenStartAndEndDates(news.SunriseDate, startDate.Value, endDate.Value) : _dateComparer.DateNowIsWithinSunriseAndSunsetDates(news.SunriseDate, news.SunsetDate)); }