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); }
public void GetDateOfNextWeek_Failed2() { Assert.AreEqual(DateTime.MaxValue, DateTimeUtility.GetDateOfNextWeek(new DateTime(9999, 12, 24), DayOfWeek.Saturday)); }
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)); }