/// <summary> /// The method validates whether a supplied object has a length not greater than required. /// </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.IsWithinLength(objectToValidate, controlLength)); }
public void ShouldReturnFalseForObject() { object testObject = new object(); Assert.IsFalse(ValidateDataProperties.IsWithinLength(testObject, controlLengthString)); }
public void ShouldReturnFalseForValidatableObject() { LengthValidatableObjectFalse testValidatableObject = new LengthValidatableObjectFalse(); Assert.IsFalse(ValidateDataProperties.IsWithinLength(testValidatableObject, 5)); }
public void ShouldReturnFalseForStringValue() { testValueString = "Length less than 20!!!!"; Assert.IsFalse(ValidateDataProperties.IsWithinLength(testValueString, controlLengthString)); }
public void ShouldReturnTrueForObject() { LengthValidatableObjectTrue testValidatableObject = new LengthValidatableObjectTrue(); Assert.IsTrue(ValidateDataProperties.IsWithinLength(testValidatableObject, 25)); }
public void ShouldReturnTrueForStringValue() { Assert.IsTrue(ValidateDataProperties.IsWithinLength(testValueString, controlLengthString)); }
public void ShouldReturnFalseForDecimalValue() { testValueDecimal = 1.0M; Assert.IsFalse(ValidateDataProperties.IsWithinLength(testValueDecimal, controlLength)); }
public void ShouldReturnTrueForDecimalValue() { Assert.IsTrue(ValidateDataProperties.IsWithinLength(testValueDecimal, controlLength)); }
public void ShouldReturnFalseForDoubleValue() { testValueDouble = 10.1F; Assert.IsFalse(ValidateDataProperties.IsWithinLength(testValueDouble, controlLength)); }
public void ShouldReturnFalseForIntValue() { testValueInt = 11; Assert.IsFalse(ValidateDataProperties.IsWithinLength(testValueInt, controlLength)); }