Example #1
0
        public void IsWorkingTime_ReturnsFalse_ForWeekend()
        {

            //Arrange
            HolidaysManager manager = new HolidaysManager();
            DateTime checkedDate = new DateTime(2017, 5, 6, 11, 15, 0);

            //Act

            //Assert
            bool isWorkingTime = manager.IsWorkingTime(checkedDate);
            Assert.IsFalse(isWorkingTime);

        }
Example #2
0
        public void IsWorkingTime_ReturnsFalse_ForWeekDayHoliday()
        {

            //Arrange
            HolidaysManager manager = new HolidaysManager();
            DateTime checkedDate = new DateTime(2017, 5, 2, 11, 15, 0);

            //Act
            manager.AddHoliday(checkedDate.Midnight());

            //Assert
            bool isWorkingTime = manager.IsWorkingTime(checkedDate);
            Assert.IsFalse(isWorkingTime);

        }
Example #3
0
        public void IsWorkingTime_ReturnsFalse_ForWorkingDayBeforeHolidayAfterEveningBreak()
        {

            //Arrange
            HolidaysManager manager = new HolidaysManager();
            DateTime checkedDate = new DateTime(2017, 5, 3, 21, 15, 0);

            //Act
            manager.AddHoliday(new DateTime(2017, 5, 4));
            manager.SetHolidayEveBreak(new TimeSpan(3, 0, 0));

            //Assert
            bool isWorkingTime = manager.IsWorkingTime(checkedDate);
            Assert.IsFalse(isWorkingTime);

        }