• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Globalization.KoreanCalendar类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中System.Globalization.KoreanCalendar的典型用法代码示例。如果您正苦于以下问题:C# KoreanCalendar类的具体用法?C# KoreanCalendar怎么用?C# KoreanCalendar使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



KoreanCalendar类属于System.Globalization命名空间,在下文中一共展示了KoreanCalendar类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: PosTest1

 public void PosTest1()
 {
     System.Globalization.Calendar kC = new KoreanCalendar();
     Assert.NotNull(kC);
     Assert.Equal(1, kC.MinSupportedDateTime.Year);
     Assert.Equal(9999, kC.MaxSupportedDateTime.Year);
 }
开发者ID:er0dr1guez,项目名称:corefx,代码行数:7,代码来源:KoreanCalendarCtor.cs


示例2: PosTest1

 public void PosTest1()
 {
     System.Globalization.Calendar kC = new KoreanCalendar();
     int expectedValue = 4362;
     int actualValue;
     actualValue = kC.TwoDigitYearMax;
     Assert.Equal(expectedValue, actualValue);
 }
开发者ID:noahfalk,项目名称:corefx,代码行数:8,代码来源:KoreanCalendarTwoDigitYearMax.cs


示例3: PosTest1

 public void PosTest1()
 {
     System.Globalization.Calendar kC = new KoreanCalendar();
     DateTime expectedValue = DateTime.MinValue;
     DateTime actualValue;
     actualValue = kC.MinSupportedDateTime;
     Assert.Equal(expectedValue, actualValue);
 }
开发者ID:er0dr1guez,项目名称:corefx,代码行数:8,代码来源:KoreanCalendarMinSupportedDateTime.cs


示例4: PosTest2

 public void PosTest2()
 {
     System.Globalization.Calendar kC = new KoreanCalendar();
     DateTime dateTime = new GregorianCalendar().ToDateTime(9999, 12, 31, 0, 0, 0, 0);
     int expectedValue = 1;
     int actualValue;
     actualValue = kC.GetEra(dateTime);
     Assert.Equal(expectedValue, actualValue);
 }
开发者ID:noahfalk,项目名称:corefx,代码行数:9,代码来源:KoreanCalendarGetEra.cs


示例5: PosTest3

 public void PosTest3()
 {
     System.Globalization.Calendar kC = new KoreanCalendar();
     DateTime dateTime = new GregorianCalendar().ToDateTime(2008, 2, 29, 0, 0, 0, 0);
     int expectedValue = 29;
     int actualValue;
     actualValue = kC.GetDayOfMonth(dateTime);
     Assert.Equal(expectedValue, actualValue);
 }
开发者ID:noahfalk,项目名称:corefx,代码行数:9,代码来源:KoreanCalendarGetDayOfMonth.cs


示例6: PosTest2

 public void PosTest2()
 {
     System.Globalization.Calendar kC = new KoreanCalendar();
     DateTime maxDT = DateTime.MaxValue;
     DateTime expectedValue = new GregorianCalendar().ToDateTime(maxDT.Year, maxDT.Month, maxDT.Day, 0, 0, 0, 0);
     DateTime actualValue;
     actualValue = kC.AddMonths(expectedValue, -2);
     Assert.Equal(kC.GetMonth(expectedValue) - 2, kC.GetMonth(actualValue));
 }
开发者ID:noahfalk,项目名称:corefx,代码行数:9,代码来源:KoreanCalendarAddMonths.cs


示例7: NegTest2

 public void NegTest2()
 {
     System.Globalization.Calendar kC = new KoreanCalendar();
     DateTime actualValue;
     Assert.Throws<ArgumentOutOfRangeException>(() =>
     {
         actualValue = kC.AddMonths(new GregorianCalendar().ToDateTime(9999, 12, 31, 0, 0, 0, 0), 5);
     });
 }
开发者ID:noahfalk,项目名称:corefx,代码行数:9,代码来源:KoreanCalendarAddMonths.cs


示例8: PosTest2

 public void PosTest2()
 {
     System.Globalization.Calendar kC = new KoreanCalendar();
     DateTime dateTime = new DateTime(DateTime.MaxValue.Ticks, DateTimeKind.Utc);
     int expectedValue = dateTime.Month;
     int actualValue;
     actualValue = kC.GetMonth(dateTime);
     Assert.Equal(expectedValue, actualValue);
 }
开发者ID:er0dr1guez,项目名称:corefx,代码行数:9,代码来源:KoreanCalendarGetMonth.cs


示例9: PosTest3

 public void PosTest3()
 {
     System.Globalization.Calendar kC = new KoreanCalendar();
     System.Globalization.Calendar gC = new GregorianCalendar();
     DateTime dateTime = gC.ToDateTime(2004, 2, 29, 0, 0, 0, 0);
     int expectedValue = gC.GetMonthsInYear(dateTime.Year, gC.GetEra(dateTime));
     int actualValue;
     actualValue = kC.GetMonthsInYear(dateTime.Year + 2333, kC.GetEra(dateTime));
     Assert.Equal(expectedValue, actualValue);
 }
开发者ID:noahfalk,项目名称:corefx,代码行数:10,代码来源:KoreanCalendarGetMonthsInYear.cs


示例10: PosTest2

 public void PosTest2()
 {
     System.Globalization.Calendar kC = new KoreanCalendar();
     System.Globalization.Calendar gC = new GregorianCalendar();
     DateTime dateTime = new DateTime(DateTime.MaxValue.Ticks, DateTimeKind.Utc);
     int expectedValue = gC.GetMonthsInYear(dateTime.Year, gC.GetEra(dateTime));
     int actualValue;
     actualValue = kC.GetMonthsInYear(dateTime.Year + 2333, kC.GetEra(dateTime));
     Assert.Equal(expectedValue, actualValue);
 }
开发者ID:noahfalk,项目名称:corefx,代码行数:10,代码来源:KoreanCalendarGetMonthsInYear.cs


示例11: PosTest3

 public void PosTest3()
 {
     System.Globalization.Calendar kC = new KoreanCalendar();
     DateTime dateTime = new GregorianCalendar().ToDateTime(2004, 2, 29, 1, 1, 1, 0);
     DateTime expectedValue = dateTime;
     DateTime actualValue;
     actualValue = kC.ToDateTime(dateTime.Year + 2333, dateTime.Month, dateTime.Day,
         dateTime.Hour, dateTime.Minute, dateTime.Second, dateTime.Millisecond, kC.GetEra(dateTime));
     Assert.Equal(expectedValue, actualValue);
 }
开发者ID:er0dr1guez,项目名称:corefx,代码行数:10,代码来源:KoreanCalendarToDateTime.cs


示例12: PosTest2

 public void PosTest2()
 {
     System.Globalization.Calendar kC = new KoreanCalendar();
     System.Globalization.Calendar gC = new GregorianCalendar();
     DateTime dateTime = new GregorianCalendar().ToDateTime(9999, 12, 31, 0, 0, 0, 0);
     int expectedValue = gC.GetDaysInMonth(dateTime.Year, dateTime.Month, gC.GetEra(dateTime));
     int actualValue;
     actualValue = kC.GetDaysInMonth(dateTime.Year + 2333, dateTime.Month, kC.GetEra(dateTime));
     Assert.Equal(expectedValue, actualValue);
 }
开发者ID:er0dr1guez,项目名称:corefx,代码行数:10,代码来源:KoreanCalendarGetDaysInMonth.cs


示例13: PosTest1

 public void PosTest1()
 {
     DateTime dateTime = DateTime.MinValue;
     int yearAdd = _generator.GetInt16(-55) % 9999;
     DateTime expectedValue = new GregorianCalendar().ToDateTime(dateTime.Year + yearAdd, dateTime.Month, dateTime.Day, 0, 0, 0, 0);
     DateTime actualValue;
     System.Globalization.Calendar kC = new KoreanCalendar();
     actualValue = kC.AddYears(dateTime, yearAdd);
     Assert.Equal(kC.GetYear(expectedValue), kC.GetYear(actualValue));
 }
开发者ID:noahfalk,项目名称:corefx,代码行数:10,代码来源:KoreanCalendarAddYears.cs


示例14: NegTest2

 public void NegTest2()
 {
     System.Globalization.Calendar kC = new KoreanCalendar();
     int era = kC.GetEra(new DateTime());
     int actualValue;
     Assert.Throws<ArgumentOutOfRangeException>(() =>
     {
         actualValue = kC.GetDaysInMonth(2333, era);
     });
 }
开发者ID:noahfalk,项目名称:corefx,代码行数:10,代码来源:KoreanCalendarGetMonthsInYear.cs


示例15: PosTest3

 public void PosTest3()
 {
     System.Globalization.Calendar kC = new KoreanCalendar();
     System.Globalization.Calendar gC = new GregorianCalendar();
     DateTime dateTime = gC.ToDateTime(2008, 2, 29, 0, 0, 0, 0);
     int expectedValue = gC.GetWeekOfYear(dateTime, new CultureInfo("en-US").DateTimeFormat.CalendarWeekRule, new CultureInfo("en-US").DateTimeFormat.FirstDayOfWeek);
     int actualValue;
     actualValue = kC.GetWeekOfYear(kC.ToDateTime(dateTime.Year + 2333, dateTime.Month, dateTime.Day, 0, 0, 0, 0), new CultureInfo("ko-KR").DateTimeFormat.CalendarWeekRule, new CultureInfo("ko-KR").DateTimeFormat.FirstDayOfWeek);
     Assert.Equal(expectedValue, actualValue);
 }
开发者ID:er0dr1guez,项目名称:corefx,代码行数:10,代码来源:KoreanCalendarGetWeekOfYear.cs


示例16: PosTest3

 public void PosTest3()
 {
     System.Globalization.Calendar kC = new KoreanCalendar();
     DateTime leapDT = new GregorianCalendar().ToDateTime(2003, 1, 29, 0, 0, 0, 0);
     DateTime expectedValue = leapDT;
     DateTime actualValue;
     actualValue = kC.AddMonths(expectedValue, 1);
     Assert.Equal(kC.GetMonth(expectedValue) + 1, kC.GetMonth(actualValue));
     Assert.Equal(kC.GetDayOfMonth(expectedValue) - 1, kC.GetDayOfMonth(actualValue));
 }
开发者ID:noahfalk,项目名称:corefx,代码行数:10,代码来源:KoreanCalendarAddMonths.cs


示例17: PosTest1

 public void PosTest1()
 {
     System.Globalization.Calendar kC = new KoreanCalendar();
     System.Globalization.Calendar gC = new GregorianCalendar();
     DateTime dateTime = gC.ToDateTime(1, 1, 1, 0, 0, 0, 0);
     int expectedValue = gC.GetYear(dateTime) + 2333;
     int actualValue;
     actualValue = kC.GetYear(dateTime);
     Assert.Equal(expectedValue, actualValue);
 }
开发者ID:er0dr1guez,项目名称:corefx,代码行数:10,代码来源:KoreanCalendarGetYear.cs


示例18: PosTest4

 public void PosTest4()
 {
     int yearAdd = TestLibrary.Generator.GetInt16(-55) % 2000 * (-1);
     DateTime dateTime = new DateTime(2000, 1, 1);
     DateTime expectedValue = new GregorianCalendar().ToDateTime(dateTime.Year + yearAdd, dateTime.Month, dateTime.Day, 0, 0, 0, 0);
     DateTime actualValue;
     System.Globalization.Calendar kC = new KoreanCalendar();
     actualValue = kC.AddYears(dateTime, yearAdd);
     Assert.Equal(kC.GetYear(expectedValue), kC.GetYear(actualValue));
 }
开发者ID:johnhhm,项目名称:corefx,代码行数:10,代码来源:KoreanCalendarAddYears.cs


示例19: PosTest1

 public void PosTest1()
 {
     System.Globalization.Calendar kC = new KoreanCalendar();
     int[] eras;
     int expectedValue = 1;
     int actualValue;
     eras = kC.Eras;
     actualValue = eras[0];
     Assert.Equal(expectedValue, actualValue);
     Assert.Equal(1, eras.Length);
 }
开发者ID:noahfalk,项目名称:corefx,代码行数:11,代码来源:KoreanCalendarEras.cs


示例20: NegTest1

 public void NegTest1()
 {
     System.Globalization.Calendar kC = new KoreanCalendar();
     int year = 2333;
     int era = 1;
     bool actualValue;
     Assert.Throws<ArgumentOutOfRangeException>(() =>
     {
         actualValue = kC.IsLeapYear(year, era);
     });
 }
开发者ID:johnhhm,项目名称:corefx,代码行数:11,代码来源:KoreanCalendarIsLeapYear.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Globalization.Message类代码示例发布时间:2022-05-26
下一篇:
C# Globalization.IdnMapping类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap