Ejemplo n.º 1
0
        public void IsHoliday_ReturnsTrue_ForDateAddedToHolidaysInTheMiddleOfDay()
        {

            //Arrange
            HolidaysManager manager = new HolidaysManager();
            DateTime holiday = new DateTime(2017, 5, 1);
            DateTime checkedDate = new DateTime(2017, 5, 1, 13, 14, 21);

            //Act
            manager.AddHoliday(holiday);

            //Assert
            bool isHoliday = manager.IsHoliday(checkedDate);
            Assert.IsTrue(isHoliday);

        }
Ejemplo n.º 2
0
        public void IsHoliday_ReturnsFalse_ForDateNotAddedToHolidays()
        {

            //Arrange
            HolidaysManager manager = new HolidaysManager();
            DateTime holiday = new DateTime(2017, 5, 1);
            DateTime checkedDate = new DateTime(2017, 5, 2);

            //Act
            manager.AddHoliday(holiday);

            //Assert
            bool isHoliday = manager.IsHoliday(checkedDate);
            Assert.IsFalse(isHoliday);

        }
Ejemplo n.º 3
0
        public void IsHoliday_ReturnsTrue_IfDateIsAddedAsHoliday()
        {

            //Arrange
            HolidaysManager manager = new HolidaysManager();
            DateTime holiday = new DateTime(2017, 5, 1);
            DateTime checkedDate = new DateTime(2017, 5, 1);
            
            //Act
            manager.AddHoliday(holiday);

            //Assert
            bool isHoliday = manager.IsHoliday(checkedDate);
            Assert.IsTrue(isHoliday);

        }
Ejemplo n.º 4
0
        public void LoadHolidays_ReturnsTrue_ForDateAddedAsListItem()
        {

            //Arrange
            HolidaysManager manager = new HolidaysManager();
            List<DateTime> holidays = new List<DateTime>();
            holidays.Add(new DateTime(2017, 5, 1));
            holidays.Add(new DateTime(2017, 5, 3));
            holidays.Add(new DateTime(2017, 11, 11));
            DateTime checkedDate = new DateTime(2017, 5, 2);

            //Act
            manager.LoadHolidays(holidays);

            //Assert
            bool isHoliday = manager.IsHoliday(checkedDate);
            Assert.IsFalse(isHoliday);

        }