System.Globalization.Calendar.GetLeapMonth C# (CSharp) Method

GetLeapMonth() private method

private GetLeapMonth ( int year ) : int
year int
return int
        public virtual int GetLeapMonth(int year)
        {
            return (GetLeapMonth(year, CurrentEra));
        }

Same methods

Calendar::GetLeapMonth ( int year, int era ) : int

Usage Example

 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");
 }