Exemplo n.º 1
0
        public void MonthEndExtractorGetsMonthEndsWeekendsThrowsIfStartDateIsGreaterThanEndDate()
        {
            DateTime start = new DateTime(2018, 11, 27);
            DateTime end   = new DateTime(2018, 08, 08);

            Assert.Throws <ArgumentException>(() => MonthEndExtractor.GetWeekendsMonthEnds(start, end).ToList());
        }
Exemplo n.º 2
0
        public void MonthEndExtractorGetsMonthEndOccurringOnEndDate()
        {
            DateTime start = new DateTime(2018, 08, 08);
            DateTime end   = new DateTime(2018, 11, 30);

            var monthEnds = MonthEndExtractor.GetMonthEnds(start, end).ToList();

            Assert.IsTrue(monthEnds.Contains(end));
        }
Exemplo n.º 3
0
        public void MonthEndExtractorGetsExpectedMonthEndWeekends()
        {
            DateTime start = new DateTime(2018, 08, 08);
            DateTime end   = new DateTime(2018, 11, 27);

            var monthEnds = MonthEndExtractor.GetWeekendsMonthEnds(start, end).ToList();

            Assert.AreEqual(new DateTime(2018, 09, 30), monthEnds[0]);
        }
Exemplo n.º 4
0
        public void MonthEndExtractorReturnsMonthEndsForFiveHundredYearWeekDaysRange()
        {
            DateTime start = new DateTime(2000, 1, 1);
            DateTime end   = start.AddYears(500);

            var monthEnds = MonthEndExtractor.GetWeekdayMonthEnds(start, end)
                            .ToList();

            Assert.IsNotNull(monthEnds);
        }
Exemplo n.º 5
0
        public void MonthEndExtractorReturnsMonthEndsForTenYearRange()
        {
            DateTime start = new DateTime(2000, 1, 1);
            DateTime end   = start.AddYears(10);

            var monthEnds = MonthEndExtractor.GetMonthEnds(start, end)
                            .ToList();

            Assert.IsNotNull(monthEnds);
        }
Exemplo n.º 6
0
        public void MonthEndExtractorGetsMonthEndWeekdays()
        {
            DateTime start = new DateTime(2018, 08, 08);
            DateTime end   = new DateTime(2018, 11, 27);

            var monthEnds = MonthEndExtractor.GetWeekdayMonthEnds(start, end).ToList();

            Assert.IsNotNull(monthEnds);
            Assert.AreEqual(2, monthEnds.Count);
        }