public void SetHourSafe_upper_bounding_applied() { var dateTime = new DateTime(2014, 7, 7, 22, 32, 46); var actual = dateTime.SetHourSafe(100); Assert.AreEqual(23, actual.Hour); }
public void SetHourSafe_preserves_year() { var dateTime = new DateTime(2014, 7, 7, 22, 32, 46); var actual = dateTime.SetHourSafe(5); Assert.AreEqual(dateTime.Year, actual.Year); }
public void SetHourSafe_preserves_second() { var dateTime = new DateTime(2014, 7, 7, 22, 32, 46); var actual = dateTime.SetHourSafe(5); Assert.AreEqual(dateTime.Second, actual.Second); }
public void SetHourSafe_preserves_month() { var dateTime = new DateTime(2014, 7, 7, 22, 32, 46); var actual = dateTime.SetHourSafe(5); Assert.AreEqual(dateTime.Month, actual.Month); }
public void SetHourSafe_preserves_day() { var dateTime = new DateTime(2014, 7, 7, 22, 32, 46); var actual = dateTime.SetHourSafe(5); Assert.AreEqual(dateTime.Day, actual.Day); }
public void SetHourSafe() { var dateTime = new DateTime(2014, 7, 7, 22, 32, 46); const int newHour = 5; var actual = dateTime.SetHourSafe(newHour); Assert.AreEqual(newHour, actual.Hour); }