Пример #1
0
        public void HasCorrectNextWorkingdayDateZaEaster()
        {
            DateCalculator.DateCalculator dateCalculator = new DateCalculator.DateCalculator();

            string   countryCode = "za";
            DateTime currentDate = new DateTime(2018, 3, 29);

            DateTime workingday = dateCalculator.GetNextWorkday(countryCode, currentDate);

            Assert.AreEqual(new DateTime(2018, 4, 3), workingday);
        }
Пример #2
0
        public void HasCorrectNextWorkingdayDateEgFriday()
        {
            DateCalculator.DateCalculator dateCalculator = new DateCalculator.DateCalculator();

            string   countryCode = "eg";
            DateTime currentDate = new DateTime(2018, 5, 11);

            DateTime workingday = dateCalculator.GetNextWorkday(countryCode, currentDate);

            Assert.AreEqual(new DateTime(2018, 5, 12), workingday);
        }
Пример #3
0
        public void HasCorrectPreviousWorkingdayDateCustom()
        {
            DateCalculator.DateCalculator dateCalculator = new DateCalculator.DateCalculator();
            dateCalculator.workdayCalculators.Add("in", (date) => { return(new InWorkdayCalculator(date)); });

            string   countryCode = "in";
            DateTime currentDate = new DateTime(2018, 5, 14);

            DateTime workingday = dateCalculator.GetPreviousWorkday(countryCode, currentDate);

            Assert.AreEqual(new DateTime(2018, 5, 12), workingday);
        }