Пример #1
0
        public void SameWeekTest()
        {
            DateTime start = new DateTime(2020, 1, 14);
            DateTime end   = new DateTime(2020, 1, 16);
            int      days  = _calculator.Calculate(start, end);

            Assert.AreEqual(3, days);
        }
Пример #2
0
        public void CalculateIndividuallyTest()
        {
            DateTime endDate = new DateTime(2020, 1, 31);

            foreach (int[] pair in _january2020)
            {
                DateTime start = new DateTime(2020, 1, pair[0]);
                int      days  = _calculator.Calculate(start, endDate);
                Assert.AreEqual(pair[1], days);
            }
        }
        public void CalculateForPartialMonthTest()
        {
            WorkingDaysCalculator calculator = new WorkingDaysCalculator();
            DateTime endDate = new DateTime(2020, 1, 21);

            foreach (int[] pair in _january2020)
            {
                DateTime start = new DateTime(2020, 1, pair[0]);
                int      days  = calculator.Calculate(start, endDate);
                Assert.AreEqual(pair[1], days);
            }
        }