Ejemplo n.º 1
0
        public void TestNullIsValidTimeOfDay()
        {
            // ARRANGE
            ValidTimeOfDayAttribute attribute = new ValidTimeOfDayAttribute();

            // ACT
            bool isValid = attribute.IsValid(null !);

            // ASSERT
            Assert.IsTrue(isValid);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
0
        public void TestNonTimeSpanIsInvalid()
        {
            // ARRANGE
            DateTime paramTimeOfDay           = DateTime.Today;
            ValidTimeOfDayAttribute attribute = new ValidTimeOfDayAttribute();

            // ACT
            bool isValid = attribute.IsValid(paramTimeOfDay);

            // ASSERT
            Assert.IsFalse(isValid);
        }
Ejemplo n.º 6
0
        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);
        }
Ejemplo n.º 7
0
        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);
        }