public void TestInvalidStartDateFutureDate() { StartEndDateTime sedt = new StartEndDateTime(); sedt.StartDate = "21000615"; DateTime dt = DateTime.UtcNow; string today = string.Format("{0:d4}{1:d2}{2:d2}", dt.Year, dt.Month, dt.Day); // this may fail on very rare occasions when tests run right at midnight Assert.AreEqual(today, sedt.ValidStartDate); }
public void TestValidEndDateValidDate() { StartEndDateTime sedt = new StartEndDateTime(); sedt.EndDate = "20130615"; Assert.AreEqual("20130615", sedt.ValidEndDate); }
public void TestInvalidStartTimeInvalidTime() { StartEndDateTime sedt = new StartEndDateTime(); sedt.StartTime = "2405"; Assert.AreEqual("0000", sedt.ValidStartTime); }
public void TestInvalidStartDate19291231() { StartEndDateTime sedt = new StartEndDateTime(); sedt.StartDate = "19291231"; Assert.AreEqual("19300101", sedt.ValidStartDate); }
public void TestValidTimeValidTime() { StartEndDateTime sedt = new StartEndDateTime(); sedt.StartTime = "201235"; Assert.AreEqual("201235", sedt.ValidStartTime); }