Exemplo n.º 1
0
        public void ifHoliday_ReturnNonHoliday()
        {
            var      holidayOrNot = new HolidayService <IHolidayService>();
            bool     notHoliday   = false;
            DateTime dueDate      = new DateTime(2019, 12, 25);
            var      check        = holidayOrNot.isHoliday(dueDate);

            if (check == true)
            {
                notHoliday = true;
            }

            Assert.AreEqual(notHoliday, check);
        }
Exemplo n.º 2
0
        public void IfHolidayReturnWeekday()
        {
            var      holiday  = new HolidayService <IHolidayService>();
            DateTime holiDate = new DateTime(2018, 9, 20);
            var      check    = holiday.isHoliday(holiDate);
            bool     weekDay  = false;

            if (check == true)
            {
                DateTime nextDay = holiDate.AddDays(1);
                if (nextDay.DayOfWeek != DayOfWeek.Saturday || nextDay.DayOfWeek != DayOfWeek.Sunday)
                {
                    weekDay = true;
                }
                else
                {
                    nextDay.AddDays(1);
                }
            }

            Assert.AreEqual(check, weekDay);
        }
Exemplo n.º 3
0
 public Bill(HolidayService hs)
 {
     this.holidayService = hs;
 }