Exemplo n.º 1
0
        public void GetNextWorkingDay_ReturnsNextMonday_IfNextDayIsSaturday()
        {

            //Arrange
            HolidaysManager manager = new HolidaysManager();
            DateTime baseDate = new DateTime(2017, 5, 5);

            //Act
            DateTime date = manager.GetNextWorkingDay(baseDate);

            //Assert
            DateTime expectedDate = new DateTime(2017, 5, 8);
            Assert.AreEqual(expectedDate, date);

        }
Exemplo n.º 2
0
        public void GetNextWorkingDay_ReturnsNextTuesday_IfItIsFridayAndMondayIsHoliday()
        {

            //Arrange
            HolidaysManager manager = new HolidaysManager();
            manager.AddHoliday(new DateTime(2017, 5, 8));
            DateTime baseDate = new DateTime(2017, 5, 5);

            //Act
            DateTime date = manager.GetNextWorkingDay(baseDate);

            //Assert
            DateTime expectedDate = new DateTime(2017, 5, 9);
            Assert.AreEqual(expectedDate, date);

        }
Exemplo n.º 3
0
        public void GetNextWorkingDay_ReturnsTwoDaysLater_IfNextDayIsMiddleWeekHoliday()
        {

            //Arrange
            HolidaysManager manager = new HolidaysManager();
            manager.AddHoliday(new DateTime(2017, 5, 3));
            DateTime baseDate = new DateTime(2017, 5, 2);

            //Act
            DateTime date = manager.GetNextWorkingDay(baseDate);

            //Assert
            DateTime expectedDate = new DateTime(2017, 5, 4);
            Assert.AreEqual(expectedDate, date);

        }