public void Should_GetDate_Throw_Exception_When_Given_Year_Is_Below_Min_Value() { var dayInMonthHoliday = new DayInMonthHoliday(6, DayOfWeek.Monday, 2); Assert.Throws <ArgumentOutOfRangeException>(() => dayInMonthHoliday.GetDate(DateTime.MinValue.Year - 1)); }
public void Should_GetDate_Return_Calculated_Holiday_Date_When_For_Given_Year() { var dayInMonthHoliday = new DayInMonthHoliday(6, DayOfWeek.Monday, 2); var result = dayInMonthHoliday.GetDate(2014); Assert.Equal(new DateTime(2014, 6, 9), result); }
ShouldBusinessDaysBetweenTwoDates_Returns_NumbersOfDaysBetween_TwoDates_With_Given_Certain_Occurrence_On_A_Certain_Day_In_A_Month() { var businessDayCounterService = new BusinessDayCounterService(); var dayInMonthHoliday = new DayInMonthHoliday(6, DayOfWeek.Monday, 2); //Queen's Birthday on the second Monday of June every Year var result = businessDayCounterService.BusinessDaysBetweenTwoDates( new DateTime(2014, 06, 01), new DateTime(2014, 06, 23), new List <IPublicHoliday>() { dayInMonthHoliday } ); Assert.Equal(14, result); }