コード例 #1
0
 public void NextYear_IfNextYearDoesNotHaveTheSameDayInTheSameMonthThenCalculateHowManyDaysIsMissingAndAddThatToTheLastDayInTheSameMonthNextYear()
 {
     var someBirthday = new DateTime(2008, 2, 29, 17, 0, 0, 0, DateTimeKind.Local);
     var nextYear = someBirthday.NextYear();
     var expected = new DateTime(2009, 3, 1, 17, 0, 0, 0, DateTimeKind.Local);
     DateAssert.AreEqual(expected, nextYear);
 }
コード例 #2
0
 public void NextYear_ReturnsTheSameDateButNextYear()
 {
     var birthday = new DateTime(1976, 12, 31, 17, 0, 0, 0, DateTimeKind.Local);
     var nextYear = birthday.NextYear();
     var expected = new DateTime(1977, 12, 31, 17, 0, 0, 0, DateTimeKind.Local);
     DateAssert.AreEqual(expected, nextYear);
 }