예제 #1
0
        public void GetNextTimeOff_ReturnsWeekendStart_IfThereIsNoFutureHoliday()
        {

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

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

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

        }
예제 #2
0
        public void GetNextTimeOff_ReturnsWeekendStart_IfItIsEarlierThanNextHoliday()
        {

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

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

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

        }
예제 #3
0
        public void GetNextTimeOff_ReturnsClosestRegisteredHoliday_IfItIsEarlierThanWeekend()
        {

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

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

            //Assert
            DateTime expectedDate = new DateTime(2017, 5, 2, 21, 0, 0);
            Assert.AreEqual(expectedDate, date);

        }