public void DateTimeResultTO_SetProperties_Months_Equal_0_DaysOfYear_NotEqual_0() { var dateTimeResultTO = new DateTimeResultTO { Years = 0, Months = 0, DaysOfYear = 20 }; dateTimeResultTO.ToDateTime(); Assert.AreEqual(1, dateTimeResultTO.Years); Assert.AreEqual(1, dateTimeResultTO.Months); Assert.AreEqual(20, dateTimeResultTO.Days); }
public void DateTimeResultTO_SetProperties_Months_Equal_0_Weeks_NotEqual_0() { var dateTimeResultTO = new DateTimeResultTO { Years = 0, Months = 0, Weeks = 20 }; dateTimeResultTO.ToDateTime(); var tmpDate = CultureInfo.CurrentCulture.Calendar.AddWeeks(new System.DateTime(1, 1, 1), 20); var Months = tmpDate.Month; var Days = tmpDate.Day; Assert.AreEqual(1, dateTimeResultTO.Years); Assert.AreEqual(Months, dateTimeResultTO.Months); Assert.AreEqual(Days, dateTimeResultTO.Days); }
public void DateTimeResultTO_SetProperties_Everything_Equal_0() { var dateTimeResultTO = new DateTimeResultTO { Years = 0, Months = 0, Days = 0, Hours = 0, Seconds = 0, Milliseconds = 0, DaysOfYear = 0, Weeks = 0 }; dateTimeResultTO.ToDateTime(); Assert.AreEqual(1, dateTimeResultTO.Years); Assert.AreEqual(1, dateTimeResultTO.Months); Assert.AreEqual(1, dateTimeResultTO.Days); Assert.AreEqual(0, dateTimeResultTO.Hours); Assert.AreEqual(0, dateTimeResultTO.Minutes); Assert.AreEqual(0, dateTimeResultTO.Seconds); Assert.AreEqual(0, dateTimeResultTO.Milliseconds); }