本文整理汇总了C#中System.Globalization.GregorianCalendar.IsLeapMonth方法的典型用法代码示例。如果您正苦于以下问题:C# GregorianCalendar.IsLeapMonth方法的具体用法?C# GregorianCalendar.IsLeapMonth怎么用?C# GregorianCalendar.IsLeapMonth使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Globalization.GregorianCalendar
的用法示例。
在下文中一共展示了GregorianCalendar.IsLeapMonth方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PosTest4
public void PosTest4()
{
System.Globalization.Calendar myCalendar = new GregorianCalendar(GregorianCalendarTypes.USEnglish);
int year, month;
bool expectedValue;
bool actualValue;
year = myCalendar.MaxSupportedDateTime.Year;
month = _generator.GetInt32(-55) % 12 + 1;
expectedValue = false;
actualValue = myCalendar.IsLeapMonth(year, month, 1);
Assert.Equal(expectedValue, actualValue);
}
示例2: PosTest2
public void PosTest2()
{
System.Globalization.Calendar myCalendar = new GregorianCalendar(GregorianCalendarTypes.USEnglish);
int year, month;
bool expectedValue;
bool actualValue;
year = GetACommonYear(myCalendar);
month = 2;
expectedValue = false;
actualValue = myCalendar.IsLeapMonth(year, month, 1);
Assert.Equal(expectedValue, actualValue);
}
示例3: PosTest3
public void PosTest3()
{
System.Globalization.Calendar myCalendar = new GregorianCalendar(GregorianCalendarTypes.USEnglish);
int year, month;
bool expectedValue;
bool actualValue;
year = GetAYear(myCalendar);
month = TestLibrary.Generator.GetInt32(-55) % 12 + 1;
expectedValue = false;
actualValue = myCalendar.IsLeapMonth(year, month, 1);
Assert.Equal(expectedValue, actualValue);
}
示例4: PosTest4
public void PosTest4()
{
System.Globalization.Calendar kC = new KoreanCalendar();
System.Globalization.Calendar gC = new GregorianCalendar();
DateTime dateTime = gC.ToDateTime(1200, 2, 29, 0, 0, 0, 0);
int year = dateTime.Year;
int month = dateTime.Month;
int era = gC.GetEra(dateTime);
bool expectedValue = gC.IsLeapMonth(year, month, era);
bool actualValue;
actualValue = kC.IsLeapMonth(year + 2333, month, kC.GetEra(dateTime));
Assert.Equal(expectedValue, actualValue);
}
示例5: NegTest1
public void NegTest1()
{
System.Globalization.Calendar myCalendar = new GregorianCalendar(GregorianCalendarTypes.USEnglish);
int year, month;
year = myCalendar.MaxSupportedDateTime.Year + 100;
month = _generator.GetInt32(-55) % 12 + 1;
Assert.Throws<ArgumentOutOfRangeException>(() =>
{
myCalendar.IsLeapMonth(year, month, 1);
});
}
示例6: NegTest5
public void NegTest5()
{
System.Globalization.Calendar myCalendar = new GregorianCalendar(GregorianCalendarTypes.USEnglish);
int year, month;
int era;
year = this.GetAYear(myCalendar);
month = 13 + _generator.GetInt32(-55) % (int.MaxValue - 12);
era = _generator.GetInt32(-55) & 1;
Assert.Throws<ArgumentOutOfRangeException>(() =>
{
myCalendar.IsLeapMonth(year, month, era);
});
}