Beispiel #1
0
        public void DateRangeInDateRange_should_return_true_if_daterange_in_range_and_false_if_daterange_not_in_range()
        {
            var startDate = new DateTime(2011, 9, 5);
            var endDate   = startDate.AddDays(3);

            var sut = new DateRange(startDate, endDate);

            sut.DateRangeInDateRange(new DateRange(startDate, endDate)).Should().BeTrue();
            sut.DateRangeInDateRange(new DateRange(startDate.AddDays(1), endDate.AddDays(-1)));
            sut.DateRangeInDateRange(new DateRange(startDate.AddDays(-1), endDate)).Should().BeFalse();
            sut.DateRangeInDateRange(new DateRange(startDate, endDate.AddDays(1))).Should().BeFalse();
        }