本文整理汇总了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);
}