コード例 #1
0
        public void ReturnsCorrectResultWhenDateIsOutsidePeriod(int year, int month, int day)
        {
            var pricingPeriod = new PricingPeriod();

            pricingPeriod.StartMonth = 2;
            pricingPeriod.StartDay   = 1;
            pricingPeriod.EndMonth   = 3;
            pricingPeriod.EndDay     = 31;
            Assert.That(pricingPeriod.ContainsDate(new DateTime(year, month, day)), Is.False);
        }
コード例 #2
0
        public void ReturnsCorrectResultWhenPeriodIsAcrossYears(int year, int month, int day)
        {
            var pricingPeriod = new PricingPeriod();

            pricingPeriod.StartMonth = 11;
            pricingPeriod.StartDay   = 1;
            pricingPeriod.EndMonth   = 2;
            pricingPeriod.EndDay     = 29;
            Assert.That(pricingPeriod.ContainsDate(new DateTime(year, month, day)));
        }
コード例 #3
0
        public void ReturnsCorrectResultWhenPeriodIsWithinYear(int year, int month, int day)
        {
            var pricingPeriod = new PricingPeriod();

            pricingPeriod.StartMonth = 4;
            pricingPeriod.StartDay   = 1;
            pricingPeriod.EndMonth   = 8;
            pricingPeriod.EndDay     = 31;
            Assert.That(pricingPeriod.ContainsDate(new DateTime(year, month, day)));
        }