Beispiel #1
0
        public void CheckDictionary()
        {
            var frenchPublicHolidaysCalculator = new Mock <IPublicHolidaysCalculator>();
            var calculator = new WorkingDaysCalculator(frenchPublicHolidaysCalculator.Object);

            calculator.GetWorkingDaysByMonth(2012, 1);
            calculator.GetWorkingDaysByMonth(2012, 1);
            calculator.GetWorkingDaysByMonth(2012, 1);
            frenchPublicHolidaysCalculator.Verify(e => e.GetPublicHolidays(2012), Times.Once);
        }
Beispiel #2
0
        public void Test(int year, int month, int expectedWorkingDays)
        {
            var calculator  = new WorkingDaysCalculator(new FrenchPublicHolidaysCalculator());
            var workingDays = calculator.GetWorkingDaysByMonth(year, month);

            Assert.Equal(expectedWorkingDays, workingDays);
        }