示例#1
0
        public void ShouldReturnTrueForDecimalValueIncluded()
        {
            decimal testValue = 10;

            Assert.IsTrue(ValidateDataProperties.IsWithinRange(testValue, minValue, maxValue, true));
        }
 /// <summary>
 /// The method validates whether a supplied object is within range defined by minimum and maximum limits.
 /// </summary>
 /// <param name="objectToValidate">An object to be valdiated.</param>
 /// <returns>True - if object is valid, false - if object is invalid.</returns>
 public override bool Validate(object objectToValidate)
 {
     return(ValidateDataProperties.IsWithinRange(objectToValidate, minValue, maxValue, includeLimits));
 }
示例#3
0
        public void ShouldReturnTrueForDecimalValue()
        {
            decimal testValue = 2;

            Assert.IsTrue(ValidateDataProperties.IsWithinRange(testValue, minValue, maxValue, false));
        }
示例#4
0
        public void ShouldReturnFalseForDoubleValueIncluded()
        {
            double testValue = 10;

            Assert.IsFalse(ValidateDataProperties.IsWithinRange(testValue, minValue, maxValue, false));
        }
示例#5
0
        public void ShouldReturnFalseForIntValue()
        {
            int testValue = 12;

            Assert.IsFalse(ValidateDataProperties.IsWithinRange(testValue, minValue, maxValue, false));
        }
示例#6
0
 public void ShouldReturnFalseForRangeValidatableObject()
 {
     Assert.IsFalse(ValidateDataProperties.IsWithinRange(falseObject, minValue, maxValue, false));
 }
示例#7
0
        public void ShouldReturnFalseForString()
        {
            string testValue = "Some text";

            Assert.IsFalse(ValidateDataProperties.IsWithinRange(testValue, minValue, maxValue, false));
        }