当前位置: 首页>>代码示例>>C#>>正文


C# GregorianCalendar.IsLeapMonth方法代码示例

本文整理汇总了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);
 }
开发者ID:er0dr1guez,项目名称:corefx,代码行数:12,代码来源:GregorianCalendarIsLeapMonth.cs

示例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);
 }
开发者ID:er0dr1guez,项目名称:corefx,代码行数:12,代码来源:GregorianCalendarIsLeapMonth.cs

示例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);
 }
开发者ID:johnhhm,项目名称:corefx,代码行数:12,代码来源:GregorianCalendarIsLeapMonth.cs

示例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);
 }
开发者ID:johnhhm,项目名称:corefx,代码行数:13,代码来源:KoreanCalendarIsLeapMonth.cs

示例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);
     });
 }
开发者ID:er0dr1guez,项目名称:corefx,代码行数:11,代码来源:GregorianCalendarIsLeapMonth.cs

示例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);
     });
 }
开发者ID:er0dr1guez,项目名称:corefx,代码行数:13,代码来源:GregorianCalendarIsLeapMonth.cs


注:本文中的System.Globalization.GregorianCalendar.IsLeapMonth方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。