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

C# Globalization.ThaiBuddhistCalendar类代码示例

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

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



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

示例1: PosTest3

 public void PosTest3()
 {
     System.Globalization.Calendar tbc = new ThaiBuddhistCalendar();
     DateTime dt = tbc.MinSupportedDateTime;
     int era = tbc.GetEra(dt);
     Assert.Equal(1, era);
 }
开发者ID:er0dr1guez,项目名称:corefx,代码行数:7,代码来源:ThaiBuddhistCalendarGetEra.cs


示例2: PosTest1

 public void PosTest1()
 {
     System.Globalization.Calendar tbc = new ThaiBuddhistCalendar();
     System.Globalization.Calendar gc = new GregorianCalendar();
     DateTime desiretdDT = gc.ToDateTime(1, 1, 1, 0, 0, 0, 0);
     Assert.Equal(tbc.MinSupportedDateTime, desiretdDT);
 }
开发者ID:noahfalk,项目名称:corefx,代码行数:7,代码来源:ThaiBuddhistCalendarMinSupportedDateTime.cs


示例3: PosTest4

 public void PosTest4()
 {
     System.Globalization.Calendar tbc = new ThaiBuddhistCalendar();
     DateTime dt = new DateTime(2000, 2, 29);
     int era = tbc.GetEra(dt);
     Assert.Equal(1, era);
 }
开发者ID:er0dr1guez,项目名称:corefx,代码行数:7,代码来源:ThaiBuddhistCalendarGetEra.cs


示例4: PosTest4

 public void PosTest4()
 {
     System.Globalization.Calendar tbc = new ThaiBuddhistCalendar();
     DateTime dt = tbc.MinSupportedDateTime;
     int i = 0;
     VerificationHelper(dt, i);
 }
开发者ID:noahfalk,项目名称:corefx,代码行数:7,代码来源:ThaiBuddhistCalendarAddYears.cs


示例5: PosTest2

 public void PosTest2()
 {
     System.Globalization.Calendar tbc = new ThaiBuddhistCalendar();
     Random rand = new Random(-55);
     int year = rand.Next(tbc.GetYear(tbc.MinSupportedDateTime), tbc.GetYear(tbc.MaxSupportedDateTime));
     Assert.Equal(year, tbc.ToFourDigitYear(year));
 }
开发者ID:er0dr1guez,项目名称:corefx,代码行数:7,代码来源:ThaiBuddhistCalendarToFourDigitYear.cs


示例6: PosTest4

 public void PosTest4()
 {
     System.Globalization.Calendar tbc = new ThaiBuddhistCalendar();
     int twoYearMax = 99;
     tbc.TwoDigitYearMax = twoYearMax;
     Assert.Equal(tbc.TwoDigitYearMax, twoYearMax);
 }
开发者ID:er0dr1guez,项目名称:corefx,代码行数:7,代码来源:ThaiBuddhistCalendarTwoDigitYearMax.cs


示例7: PosTest1

        public void PosTest1()
        {
            System.Globalization.Calendar tbc = new ThaiBuddhistCalendar();
            Random rand = new Random(-55);
            int year = rand.Next(tbc.MinSupportedDateTime.Year + 543, tbc.MaxSupportedDateTime.Year + 543);
            int month = rand.Next(1, 13);
            int day;
            if (IsLeapYear(year))
            {
                day = rand.Next(1, _DAYS_PER_MONTHS_IN_LEAP_YEAR[month] + 1);
            }
            else
            {
                day = rand.Next(1, _DAYS_PER_MONTHS_IN_NO_LEAP_YEAR[month] + 1);
            }

            int hour = rand.Next(0, 24);
            int minute = rand.Next(0, 60);
            int second = rand.Next(0, 60);
            int milliSecond = rand.Next(0, 1000);
            int era = 0;
            for (int i = 0; i < tbc.Eras.Length; i++)
            {
                era = tbc.Eras[i];
                DateTime dt = tbc.ToDateTime(year, month, day, hour, minute, second, milliSecond, era);
                DateTime desiredDT = tbc.ToDateTime(year, month, day, hour, minute, second, milliSecond);
                Assert.Equal(dt, desiredDT);
            }
        }
开发者ID:er0dr1guez,项目名称:corefx,代码行数:29,代码来源:ThaiBuddhistCalendarToDateTime.cs


示例8: PosTest3

        public void PosTest3()
        {
            System.Globalization.Calendar tbc = new ThaiBuddhistCalendar();
            DateTime dt = tbc.MaxSupportedDateTime;

            Assert.Equal(365, tbc.GetDayOfYear(dt));
        }
开发者ID:er0dr1guez,项目名称:corefx,代码行数:7,代码来源:ThaiBuddhistCalendarGetDayOfYear.cs


示例9: PosTest1

        public void PosTest1()
        {
            System.Globalization.Calendar tbc = new ThaiBuddhistCalendar();
            Random rand = new Random(-55);
            int year = rand.Next(tbc.MinSupportedDateTime.Year, tbc.MaxSupportedDateTime.Year);
            int month = rand.Next(1, 12);
            int day;
            if (IsLeapYear(year))
            {
                day = rand.Next(1, _DAYS_PER_MONTHS_IN_LEAP_YEAR[month] + 1);
            }
            else
            {
                day = rand.Next(1, _DAYS_PER_MONTHS_IN_NO_LEAP_YEAR[month] + 1);
            }

            DateTime dt = new DateTime(year, month, day);
            for (int i = 0; i < 7; i++)
            {
                for (int j = 0; j < 3; j++)
                {
                    int actualWeek = getWeekOfYear(dt, (CalendarWeekRule)j, (DayOfWeek)i);
                    int resultWeek = tbc.GetWeekOfYear(dt, (CalendarWeekRule)j, (DayOfWeek)i);
                    Assert.Equal(actualWeek, resultWeek);
                }
            }
        }
开发者ID:noahfalk,项目名称:corefx,代码行数:27,代码来源:ThaiBuddhistCalendarGetWeekOfYear.cs


示例10: PosTest4

 public void PosTest4()
 {
     System.Globalization.Calendar tbc = new ThaiBuddhistCalendar();
     tbc.TwoDigitYearMax = 2029;
     int year = 0;
     int expectedYear = 2000;
     Assert.Equal(expectedYear, tbc.ToFourDigitYear(year));
 }
开发者ID:er0dr1guez,项目名称:corefx,代码行数:8,代码来源:ThaiBuddhistCalendarToFourDigitYear.cs


示例11: PosTest1

 public void PosTest1()
 {
     System.Globalization.Calendar tbc = new ThaiBuddhistCalendar();
     System.Globalization.Calendar gc = new GregorianCalendar();
     DateTime desiretdDT = gc.ToDateTime(9999, 12, 31, 23, 59, 59, 999);
     desiretdDT = desiretdDT.AddTicks(9999);
     Assert.Equal(tbc.MaxSupportedDateTime, desiretdDT);
 }
开发者ID:noahfalk,项目名称:corefx,代码行数:8,代码来源:ThaiBuddhistCalendarMaxSupportedDateTime.cs


示例12: PosTest2

 public void PosTest2()
 {
     System.Globalization.Calendar tbc = new ThaiBuddhistCalendar();
     Random rand = new Random(-55);
     int twoYearMax = rand.Next(99, tbc.MaxSupportedDateTime.Year + 543);
     tbc.TwoDigitYearMax = twoYearMax;
     Assert.Equal(tbc.TwoDigitYearMax, twoYearMax);
 }
开发者ID:er0dr1guez,项目名称:corefx,代码行数:8,代码来源:ThaiBuddhistCalendarTwoDigitYearMax.cs


示例13: NegTest2

 public void NegTest2()
 {
     System.Globalization.Calendar tbc = new ThaiBuddhistCalendar();
     int year = 98;
     Assert.Throws<ArgumentOutOfRangeException>(() =>
     {
         tbc.TwoDigitYearMax = year;
     });
 }
开发者ID:er0dr1guez,项目名称:corefx,代码行数:9,代码来源:ThaiBuddhistCalendarTwoDigitYearMax.cs


示例14: NegTest1

 public void NegTest1()
 {
     System.Globalization.Calendar tbc = new ThaiBuddhistCalendar();
     int year = 10000 + 543;
     Assert.Throws<ArgumentOutOfRangeException>(() =>
     {
         tbc.ToFourDigitYear(year);
     });
 }
开发者ID:er0dr1guez,项目名称:corefx,代码行数:9,代码来源:ThaiBuddhistCalendarToFourDigitYear.cs


示例15: NegTest1

 public void NegTest1()
 {
     System.Globalization.Calendar tbc = new ThaiBuddhistCalendar();
     Random rand = new Random(-55);
     int year = rand.Next(tbc.MinSupportedDateTime.Year + 543, tbc.MaxSupportedDateTime.Year + 544);
     int era = 2;
     Assert.Throws<ArgumentOutOfRangeException>(() =>
     {
         tbc.GetMonthsInYear(year, era);
     });
 }
开发者ID:noahfalk,项目名称:corefx,代码行数:11,代码来源:ThaiBuddhistCalendarGetMonthsInYear.cs


示例16: PosTest1

 public void PosTest1()
 {
     System.Globalization.Calendar tbc = new ThaiBuddhistCalendar();
     Random rand = new Random(-55);
     int year = rand.Next(tbc.MinSupportedDateTime.Year + 543, tbc.MaxSupportedDateTime.Year + 544);
     int month = rand.Next(1, 13);
     int day = rand.Next(1, tbc.GetDaysInMonth(year, month) + 1);
     DateTime dt = tbc.ToDateTime(year, month, day, 0, 0, 0, 0);
     int era = tbc.GetEra(dt);
     Assert.Equal(1, era);
 }
开发者ID:er0dr1guez,项目名称:corefx,代码行数:11,代码来源:ThaiBuddhistCalendarGetEra.cs


示例17: PosTest2

 public void PosTest2()
 {
     System.Globalization.Calendar tbc = new ThaiBuddhistCalendar();
     Random rand = new Random(-55);
     int year = 2000 + 543;
     int era;
     for (int i = 0; i < tbc.Eras.Length; i++)
     {
         era = tbc.Eras[i];
         Assert.True(tbc.IsLeapYear(year, era));
     }
 }
开发者ID:er0dr1guez,项目名称:corefx,代码行数:12,代码来源:ThaiBuddhistCalendarIsLeapYear.cs


示例18: PosTest3

 public void PosTest3()
 {
     System.Globalization.Calendar tbc = new ThaiBuddhistCalendar();
     DateTime dt = tbc.MaxSupportedDateTime;
     int year = dt.Year + 543;
     int era;
     for (int i = 0; i < tbc.Eras.Length; i++)
     {
         era = tbc.Eras[i];
         Assert.Equal(_months_IN_YEAR, tbc.GetMonthsInYear(year, era));
     }
 }
开发者ID:noahfalk,项目名称:corefx,代码行数:12,代码来源:ThaiBuddhistCalendarGetMonthsInYear.cs


示例19: PosTest4

 public void PosTest4()
 {
     System.Globalization.Calendar tbc = new ThaiBuddhistCalendar();
     Random rand = new Random(-55);
     int year = tbc.MaxSupportedDateTime.Year + 543;
     int era;
     for (int i = 0; i < tbc.Eras.Length; i++)
     {
         era = tbc.Eras[i];
         Assert.False(tbc.IsLeapYear(year, era));
     }
 }
开发者ID:er0dr1guez,项目名称:corefx,代码行数:12,代码来源:ThaiBuddhistCalendarIsLeapYear.cs


示例20: PosTest1

 public void PosTest1()
 {
     System.Globalization.Calendar tbc = new ThaiBuddhistCalendar();
     Random rand = new Random(-55);
     int year = rand.Next(tbc.MinSupportedDateTime.Year + 543, tbc.MaxSupportedDateTime.Year + 544);
     int era;
     for (int i = 0; i < tbc.Eras.Length; i++)
     {
         era = tbc.Eras[i];
         Assert.Equal(_months_IN_YEAR, tbc.GetMonthsInYear(year, era));
     }
 }
开发者ID:noahfalk,项目名称:corefx,代码行数:12,代码来源:ThaiBuddhistCalendarGetMonthsInYear.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# Html.Element类代码示例发布时间:2022-05-26
下一篇:
C# Globalization.TextInfo类代码示例发布时间: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