示例#1
0
        public void DateInDateRange_should_return_true_if_date_in_range_and_false_if_date_not_in_range()
        {
            var startDate = new DateTime(2011, 9, 5, 0, 0, 0, DateTimeKind.Utc);
            var endDate   = startDate.AddDays(1);

            var sut = new DateRange(startDate, endDate);

            var date = new DateTime(2011, 9, 5, 0, 0, 0, DateTimeKind.Utc).ToUniversalTime();

            sut.DateInDateRange(date).Should().Be(true);
            sut.DateInDateRange(date.AddDays(1)).Should().Be(true);
            sut.DateInDateRange(date.AddDays(2)).Should().Be(false);
            sut.DateInDateRange(date.AddDays(-1)).Should().Be(false);
        }