當前位置: 首頁>>代碼示例>>C#>>正文


C# Globalization.KoreanCalendar類代碼示例

本文整理匯總了C#中System.Globalization.KoreanCalendar的典型用法代碼示例。如果您正苦於以下問題:C# KoreanCalendar類的具體用法?C# KoreanCalendar怎麽用?C# KoreanCalendar使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


KoreanCalendar類屬於System.Globalization命名空間,在下文中一共展示了KoreanCalendar類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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


注:本文中的System.Globalization.KoreanCalendar類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。