本文整理匯總了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);
}
示例2: PosTest1
public void PosTest1()
{
System.Globalization.Calendar kC = new KoreanCalendar();
int expectedValue = 4362;
int actualValue;
actualValue = kC.TwoDigitYearMax;
Assert.Equal(expectedValue, actualValue);
}
示例3: PosTest1
public void PosTest1()
{
System.Globalization.Calendar kC = new KoreanCalendar();
DateTime expectedValue = DateTime.MinValue;
DateTime actualValue;
actualValue = kC.MinSupportedDateTime;
Assert.Equal(expectedValue, actualValue);
}
示例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);
}
示例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);
}
示例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));
}
示例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);
});
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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));
}
示例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);
});
}
示例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);
}