public void DayOfWeekMonthReverseThrowsYearMin() { var date = DateTime.MinValue; CalendarDateTime.ClearCalendar(); CalendarDateTime.DayOfWeekMonthReverse(date.Year, date.Month, DayOfWeek.Friday, 1); Assert.Throws <ArgumentOutOfRangeException>(() => CalendarDateTime.DayOfWeekMonthReverse(date.Year - 1, date.Month, date.DayOfWeek, 1)); }
private void TestSetReverseWeekDayHolidays([NotNull] List <Holiday> assertHolidays, int expectedWeek, DayOfWeek expectedDayOfWeek, [NotNull] string expectedHoliday) { TestSetYearRange(assertHolidays); foreach (var assertHoliday in assertHolidays) { var expectedDate = CalendarDateTime.DayOfWeekMonthReverse( assertHoliday.Date.Year, assertHoliday.Date.Month, expectedDayOfWeek, expectedWeek); Assert.True(assertHoliday.Date == expectedDate, "Date miss match in the " + expectedHoliday + " set"); } }
public void DayOfWeekReverseNegInterval() { CalendarDateTime.ClearCalendar(); CalendarDateTime.DayOfWeekMonthReverse(2016, 12, DayOfWeek.Friday, 1); Assert.Throws <ArgumentException>(() => CalendarDateTime.DayOfWeekMonthForward(2016, 12, DayOfWeek.Friday, 0)); }
public void DayOfWeekMonthReverseThrowsMonthMin() { CalendarDateTime.ClearCalendar(); CalendarDateTime.DayOfWeekMonthReverse(2020, 1, DayOfWeek.Friday, 1); Assert.Throws <ArgumentOutOfRangeException>(() => CalendarDateTime.DayOfWeekMonthReverse(2008, 0, DayOfWeek.Friday, 1)); }