示例#1
0
 public void GetDateOfNextWeek_Kind()
 {
     Assert.AreEqual(DateTimeKind.Unspecified, DateTimeUtility.GetDateOfNextWeek(new DateTime(2018, 1, 1), DayOfWeek.Sunday).Kind);
     Assert.AreEqual(DateTimeKind.Local, DateTimeUtility.GetDateOfNextWeek(new DateTime(2018, 1, 1, 0, 0, 0, DateTimeKind.Local), DayOfWeek.Sunday).Kind);
     Assert.AreEqual(DateTimeKind.Utc, DateTimeUtility.GetDateOfNextWeek(new DateTime(2018, 1, 1, 0, 0, 0, DateTimeKind.Utc), DayOfWeek.Sunday).Kind);
 }
示例#2
0
 public void GetDateOfNextWeek_Failed2()
 {
     Assert.AreEqual(DateTime.MaxValue, DateTimeUtility.GetDateOfNextWeek(new DateTime(9999, 12, 24), DayOfWeek.Saturday));
 }
示例#3
0
 public void GetDateOfNextWeek()
 {
     Assert.AreEqual(new DateTime(2018, 1, 7), DateTimeUtility.GetDateOfNextWeek(new DateTime(2018, 1, 1), DayOfWeek.Sunday));
     Assert.AreEqual(new DateTime(2018, 1, 10), DateTimeUtility.GetDateOfNextWeek(new DateTime(2018, 1, 1), DayOfWeek.Wednesday));
     Assert.AreEqual(new DateTime(2018, 1, 13), DateTimeUtility.GetDateOfNextWeek(new DateTime(2018, 1, 1), DayOfWeek.Saturday));
 }