本文整理汇总了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;未经允许,请勿转载。 |
请发表评论