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); }
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); }
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); }
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); }