public void CanCalculateWindowTenMonthsBeforeSpecificDate([ValueSource("SampleDates")] DateTime today)
        {
            var startBound = DateRangeBound.CreateWindowBound(10, DateInterval.Month);
            var endBound   = DateRangeBound.CreateSpecificDateBound(today);
            var range      = new DateRange(startBound, endBound);

            Expect(range.GetStartDate(DateTime.MinValue), Is.EqualTo(today.AddMonths(-10)), "A starting window range of 10 months should always produce ten months before the end");
        }
        public void CanCalculateWindowOneMonthAfterSpecificDate([ValueSource("SampleDates")] DateTime today)
        {
            var startBound = DateRangeBound.CreateSpecificDateBound(today);
            var endBound   = DateRangeBound.CreateWindowBound(1, DateInterval.Month);
            var range      = new DateRange(startBound, endBound);

            Expect(range.GetEndDate(DateTime.MinValue), Is.EqualTo(today.AddMonths(1)), "An ending window range of 1 month should always produce one month after the start");
        }
        public void CanCalculateWindowTenDaysAfterSpecificDate([ValueSource("SampleDates")] DateTime today)
        {
            var startBound = DateRangeBound.CreateSpecificDateBound(today);
            var endBound   = DateRangeBound.CreateWindowBound(10, DateInterval.Day);
            var range      = new DateRange(startBound, endBound);

            Expect(range.GetEndDate(DateTime.MinValue), Is.EqualTo(today.AddDays(10)), "An ending window range of 10 days should always produce ten days after the start");
        }
        public void CanCalculateWindowOneDayBeforeSpecificDate([ValueSource("SampleDates")] DateTime today)
        {
            var startBound = DateRangeBound.CreateWindowBound(1, DateInterval.Day);
            var endBound   = DateRangeBound.CreateSpecificDateBound(today);
            var range      = new DateRange(startBound, endBound);

            Expect(range.GetStartDate(DateTime.MinValue), Is.EqualTo(today.AddDays(-1)), "A starting window range of 1 day should always produce one day before the end");
        }
        public void StartWindowIsValidWithEndingSpecific(
            [ValueSource("SampleWindowAmounts")] int startAmount,
            [ValueSource("AllDateInvervals")] DateInterval startInterval,
            [ValueSource("SampleDates")] DateTime endingDate)
        {
            var startBound = DateRangeBound.CreateWindowBound(startAmount, startInterval);
            var endBound   = DateRangeBound.CreateSpecificDateBound(endingDate);
            var range      = new DateRange(startBound, endBound);

            Expect(range.IsValid, Is.True, "A range from window to specific is always valid");
        }
        public void EndWindowIsValidWithStartingSpecific(
            [ValueSource("SampleDates")] DateTime starting,
            [ValueSource("SampleWindowAmounts")] int endAmount,
            [ValueSource("AllDateInvervals")] DateInterval endInterval)
        {
            var startBound = DateRangeBound.CreateSpecificDateBound(starting);
            var endBound   = DateRangeBound.CreateWindowBound(endAmount, endInterval);
            var range      = new DateRange(startBound, endBound);

            Expect(range.IsValid, Is.True, "A range from specific to window is always valid");
        }