コード例 #1
0
        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));
        }
コード例 #2
0
 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");
     }
 }
コード例 #3
0
 public void DayOfWeekReverseNegInterval()
 {
     CalendarDateTime.ClearCalendar();
     CalendarDateTime.DayOfWeekMonthReverse(2016, 12, DayOfWeek.Friday, 1);
     Assert.Throws <ArgumentException>(() => CalendarDateTime.DayOfWeekMonthForward(2016, 12, DayOfWeek.Friday, 0));
 }
コード例 #4
0
 public void DayOfWeekMonthReverseThrowsMonthMin()
 {
     CalendarDateTime.ClearCalendar();
     CalendarDateTime.DayOfWeekMonthReverse(2020, 1, DayOfWeek.Friday, 1);
     Assert.Throws <ArgumentOutOfRangeException>(() => CalendarDateTime.DayOfWeekMonthReverse(2008, 0, DayOfWeek.Friday, 1));
 }