mirror of
https://github.com/oliverbooth/X10D
synced 2024-11-09 23:25:43 +00:00
test: add tests for GetIso8601WeekOfYear
This commit is contained in:
parent
006523d342
commit
628ead1ebb
@ -37,6 +37,33 @@ public class DateTimeOffsetTests
|
||||
Assert.AreEqual(new DateTime(today.Year, today.Month, 1), today.FirstDayOfMonth());
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void GetIso8601WeekOfYear_ShouldReturn1_Given4January1970()
|
||||
{
|
||||
DateTimeOffset date = new DateTime(1970, 1, 4);
|
||||
int iso8601WeekOfYear = date.GetIso8601WeekOfYear();
|
||||
|
||||
Assert.AreEqual(1, iso8601WeekOfYear);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void GetIso8601WeekOfYear_ShouldReturn1_Given31December1969()
|
||||
{
|
||||
DateTimeOffset date = new DateTime(1969, 12, 31);
|
||||
int iso8601WeekOfYear = date.GetIso8601WeekOfYear();
|
||||
|
||||
Assert.AreEqual(1, iso8601WeekOfYear);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void GetIso8601WeekOfYear_ShouldReturn53_Given31December1970()
|
||||
{
|
||||
DateTimeOffset date = new DateTime(1970, 12, 31);
|
||||
int iso8601WeekOfYear = date.GetIso8601WeekOfYear();
|
||||
|
||||
Assert.AreEqual(53, iso8601WeekOfYear);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void IsLeapYear_ShouldBeFalse_Given1999()
|
||||
{
|
||||
|
@ -37,6 +37,33 @@ public class DateTimeTests
|
||||
Assert.AreEqual(new DateTime(today.Year, today.Month, 1), today.FirstDayOfMonth());
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void GetIso8601WeekOfYear_ShouldReturn1_Given4January1970()
|
||||
{
|
||||
var date = new DateTime(1970, 1, 4);
|
||||
int iso8601WeekOfYear = date.GetIso8601WeekOfYear();
|
||||
|
||||
Assert.AreEqual(1, iso8601WeekOfYear);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void GetIso8601WeekOfYear_ShouldReturn1_Given31December1969()
|
||||
{
|
||||
var date = new DateTime(1969, 12, 31);
|
||||
int iso8601WeekOfYear = date.GetIso8601WeekOfYear();
|
||||
|
||||
Assert.AreEqual(1, iso8601WeekOfYear);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void GetIso8601WeekOfYear_ShouldReturn53_Given31December1970()
|
||||
{
|
||||
var date = new DateTime(1970, 12, 31);
|
||||
int iso8601WeekOfYear = date.GetIso8601WeekOfYear();
|
||||
|
||||
Assert.AreEqual(53, iso8601WeekOfYear);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void IsLeapYear_ShouldBeFalse_Given1999()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user