public void TestNegativeTimeIsInvalid() { // ARRANGE TimeSpan paramTimeOfDay = -1 * new TimeSpan(14, 13, 0); ValidTimeOfDayAttribute attribute = new ValidTimeOfDayAttribute(); // ACT bool isValid = attribute.IsValid(paramTimeOfDay); // ASSERT Assert.IsFalse(isValid); }
public void TestAfternoonTimeWithMinutesIsValid() { // ARRANGE TimeSpan paramTimeOfDay = new TimeSpan(14, 13, 0); ValidTimeOfDayAttribute attribute = new ValidTimeOfDayAttribute(); // ACT bool isValid = attribute.IsValid(paramTimeOfDay); // ASSERT Assert.IsTrue(isValid); }
public void Test2359IsValidTimeOfDay() { // ARRANGE TimeSpan paramTimeOfDay = new TimeSpan(23, 59, 0); ValidTimeOfDayAttribute attribute = new ValidTimeOfDayAttribute(); // ACT bool isValid = attribute.IsValid(paramTimeOfDay); // ASSERT Assert.IsTrue(isValid); }
public void TestNonTimeSpanIsInvalid() { // ARRANGE DateTime paramTimeOfDay = DateTime.Today; ValidTimeOfDayAttribute attribute = new ValidTimeOfDayAttribute(); // ACT bool isValid = attribute.IsValid(paramTimeOfDay); // ASSERT Assert.IsFalse(isValid); }
public void TestWithSecondsIsInvalid() { // ARRANGE TimeSpan paramTimeOfDay = new TimeSpan(14, 13, 23); ValidTimeOfDayAttribute attribute = new ValidTimeOfDayAttribute(); // ACT bool isValid = attribute.IsValid(paramTimeOfDay); // ASSERT Assert.IsFalse(isValid); }
public void TestMoreThanOneDayIsInvalid() { // ARRANGE TimeSpan paramTimeOfDay = new TimeSpan(1, 1, 0, 0); ValidTimeOfDayAttribute attribute = new ValidTimeOfDayAttribute(); // ACT bool isValid = attribute.IsValid(paramTimeOfDay); // ASSERT Assert.IsFalse(isValid); }