public static void ReadOnlyTest(Calendar calendar, int yearHasLeapMonth, CalendarAlgorithmType algorithmType) { Assert.False(calendar.IsReadOnly); var readOnlyCal = Calendar.ReadOnly(calendar); Assert.True(readOnlyCal.IsReadOnly, "expect readOnlyCal.IsReadOnly returns true"); var colnedCal = (Calendar) readOnlyCal.Clone(); Assert.False(colnedCal.IsReadOnly, "expect colnedCal.IsReadOnly returns false"); }
public static void GetLeapMonthTest(Calendar calendar, int yearHasLeapMonth, CalendarAlgorithmType algorithmType) { if (yearHasLeapMonth > 0) { Assert.NotEqual(calendar.GetLeapMonth(yearHasLeapMonth), 0); Assert.Equal(0, calendar.GetLeapMonth(yearHasLeapMonth - 1)); } else Assert.True(calendar.GetLeapMonth(calendar.GetYear(DateTime.Today)) == 0, "calendar.GetLeapMonth returned wrong value"); }
public static void AlgorithmTypeTest(Calendar calendar, int yearHasLeapMonth, CalendarAlgorithmType algorithmType) { Assert.Equal(calendar.AlgorithmType, algorithmType); }
public static void CloningTest(Calendar calendar, int yearHasLeapMonth, CalendarAlgorithmType algorithmType) { Calendar cloned = (Calendar) calendar.Clone(); Assert.Equal(calendar.GetType(), cloned.GetType()); }