Ejemplo n.º 1
0
 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");
 }
Ejemplo n.º 2
0
 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");
 }
Ejemplo n.º 3
0
 public static void AlgorithmTypeTest(Calendar calendar, int yearHasLeapMonth, CalendarAlgorithmType algorithmType)
 {
     Assert.Equal(calendar.AlgorithmType, algorithmType);
 }
Ejemplo n.º 4
0
 public static void CloningTest(Calendar calendar, int yearHasLeapMonth, CalendarAlgorithmType algorithmType)
 {
     Calendar cloned = (Calendar) calendar.Clone();
     Assert.Equal(calendar.GetType(), cloned.GetType());
 }