Пример #1
0
        public void LessOrEqual_ValuesAreDates_CompareToCurrentDate_Val3EqualCurrentDate_ExpectTrue()
        {
            //Arrange
            LessOrEqualModelOfDates model = new LessOrEqualModelOfDates {
                Val3 = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day)
            };
            //Act
            bool isValid = model.PropertyIsValid("Val3");

            //Assert
            isValid.ShouldBeTrue();
        }
Пример #2
0
        public void LessOrEqual_ValuesAreDates_CompareToCurrentDate_Val3NotLessThanCurrentDate_ExpectFalse()
        {
            //Arrange
            LessOrEqualModelOfDates model = new LessOrEqualModelOfDates {
                Val3 = DateTime.Now.AddDays(1)
            };
            //Act
            bool isValid = model.PropertyIsValid("Val3");

            //Assert
            isValid.ShouldBeFalse();
        }
Пример #3
0
        public void LessOrEqual_ValuesAreDates_SpecificValue_Val1NotLessThanSpecificValue_ExpectFalse()
        {
            //Arrange
            LessOrEqualModelOfDates model = new LessOrEqualModelOfDates {
                Val1 = new DateTime(2090, 1, 1)
            };
            //Act
            bool isValid = model.PropertyIsValid("Val1");

            //Assert
            isValid.ShouldBeFalse();
        }
Пример #4
0
        public void LessOrEqual_ValuesAreDates_SpecificValue_Val1EqualSpecificValue_ExpectTrue()
        {
            //Arrange
            LessOrEqualModelOfDates model = new LessOrEqualModelOfDates {
                Val1 = new DateTime(2010, 12, 31)
            };
            //Act
            bool isValid = model.PropertyIsValid("Val1");

            //Assert
            isValid.ShouldBeTrue();
        }
Пример #5
0
        public void LessOrEqual_ValuesAreDates_Val2GreaterThanVal2_ExpectFalse()
        {
            //Arrange
            LessOrEqualModelOfDates model = new LessOrEqualModelOfDates {
                Val1 = DateTime.Now, Val2 = DateTime.Now.AddDays(1)
            };
            //Act
            bool isValid = model.PropertyIsValid("Val2");

            //Assert
            isValid.ShouldBeFalse();
        }
Пример #6
0
        public void LessOrEqual_ValuesAreDates_Val1IsNotNullAndVal2IsNull_ExpectTrue()
        {
            //Arrange
            LessOrEqualModelOfDates model = new LessOrEqualModelOfDates {
                Val1 = DateTime.Now, Val2 = null
            };
            //Act
            bool isValid = model.PropertyIsValid("Val2");

            //Assert
            isValid.ShouldBeTrue();
        }
Пример #7
0
        public void LessOrEqual_ValuesAreDates_Val2LessThanVal1_ExpectTrue()
        {
            //Arrange
            DateTime date = DateTime.Now.Date;
            LessOrEqualModelOfDates model = new LessOrEqualModelOfDates {
                Val1 = date, Val2 = date.AddDays(-1)
            };
            //Act
            bool isValid = model.PropertyIsValid("Val2");

            //Assert
            isValid.ShouldBeTrue();
        }
Пример #8
0
 public void LessOrEqual_ValuesAreDates_Val2LessThanVal1_ExpectTrue()
 {
     //Arrange
     DateTime date = DateTime.Now.Date;
     LessOrEqualModelOfDates model = new LessOrEqualModelOfDates {Val1 = date, Val2 = date.AddDays(-1)};
     //Act
     bool isValid = model.PropertyIsValid("Val2");
     //Assert
     isValid.ShouldBeTrue();
 }
Пример #9
0
 public void LessOrEqual_ValuesAreDates_Val2GreaterThanVal2_ExpectFalse()
 {
     //Arrange
     LessOrEqualModelOfDates model = new LessOrEqualModelOfDates {Val1 = DateTime.Now, Val2 = DateTime.Now.AddDays(1)};
     //Act
     bool isValid = model.PropertyIsValid("Val2");
     //Assert
     isValid.ShouldBeFalse();
 }
Пример #10
0
 public void LessOrEqual_ValuesAreDates_Val1IsNullAndVal2IsNotNull_ExpectFalse()
 {
     //Arrange
     LessOrEqualModelOfDates model = new LessOrEqualModelOfDates {Val1 = null, Val2 = DateTime.Now};
     //Act
     bool isValid = model.PropertyIsValid("Val2");
     //Assert
     isValid.ShouldBeFalse();
 }
Пример #11
0
 public void LessOrEqual_ValuesAreDates_Val1AndVal2_BothNull_ExpectTrue()
 {
     //Arrange
     LessOrEqualModelOfDates model = new LessOrEqualModelOfDates {Val1 = null, Val2 = null};
     //Act
     bool isValid = model.PropertyIsValid("Val2");
     //Assert
     isValid.ShouldBeTrue();
 }
Пример #12
0
 public void LessOrEqual_ValuesAreDates_SpecificValue_Val1NotLessThanSpecificValue_ExpectFalse()
 {
     //Arrange
     LessOrEqualModelOfDates model = new LessOrEqualModelOfDates {Val1 = new DateTime(2090, 1, 1)};
     //Act
     bool isValid = model.PropertyIsValid("Val1");
     //Assert
     isValid.ShouldBeFalse();
 }
Пример #13
0
 public void LessOrEqual_ValuesAreDates_SpecificValue_Val1EqualSpecificValue_ExpectTrue()
 {
     //Arrange
     LessOrEqualModelOfDates model = new LessOrEqualModelOfDates {Val1 = new DateTime(2010, 12, 31)};
     //Act
     bool isValid = model.PropertyIsValid("Val1");
     //Assert
     isValid.ShouldBeTrue();
 }
Пример #14
0
 public void LessOrEqual_ValuesAreDates_CompareToCurrentDate_Val3NotLessThanCurrentDate_ExpectFalse()
 {
     //Arrange
     LessOrEqualModelOfDates model = new LessOrEqualModelOfDates {Val3 = DateTime.Now.AddDays(1)};
     //Act
     bool isValid = model.PropertyIsValid("Val3");
     //Assert
     isValid.ShouldBeFalse();
 }
Пример #15
0
 public void LessOrEqual_ValuesAreDates_CompareToCurrentDate_Val3EqualCurrentDate_ExpectTrue()
 {
     //Arrange
     LessOrEqualModelOfDates model = new LessOrEqualModelOfDates {Val3 = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day)};
     //Act
     bool isValid = model.PropertyIsValid("Val3");
     //Assert
     isValid.ShouldBeTrue();
 }