IsLeapMonth() public method

public IsLeapMonth ( int year, int month, int era ) : bool
year int
month int
era int
return bool
Exemplo n.º 1
0
 public void NegTest3()
 {
     System.Globalization.Calendar tc = new TaiwanCalendar();
     Random rand = new Random(-55);
     int year = rand.Next(tc.MinSupportedDateTime.Year, tc.MaxSupportedDateTime.Year + 1);
     int month = rand.Next(12, Int32.MaxValue);
     int era = Calendar.CurrentEra;
     Assert.Throws<ArgumentOutOfRangeException>(() =>
     {
         tc.IsLeapMonth(year, month, era);
     });
 }
Exemplo n.º 2
0
 public void PosTest1()
 {
     System.Globalization.Calendar tc = new TaiwanCalendar();
     Random rand = new Random(-55);
     int year = rand.Next(tc.MinSupportedDateTime.Year, tc.MaxSupportedDateTime.Year - 1911);
     int month = rand.Next(1, 13);
     int era;
     for (int i = 0; i < tc.Eras.Length; i++)
     {
         era = tc.Eras[i];
         Assert.False(tc.IsLeapMonth(year, month, era));
     }
 }