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)); }
public void ShouldReturnTrueForDecimalValue() { decimal testValue = 2; Assert.IsTrue(ValidateDataProperties.IsWithinRange(testValue, minValue, maxValue, false)); }
public void ShouldReturnFalseForDoubleValueIncluded() { double testValue = 10; Assert.IsFalse(ValidateDataProperties.IsWithinRange(testValue, minValue, maxValue, false)); }
public void ShouldReturnFalseForIntValue() { int testValue = 12; Assert.IsFalse(ValidateDataProperties.IsWithinRange(testValue, minValue, maxValue, false)); }
public void ShouldReturnFalseForRangeValidatableObject() { Assert.IsFalse(ValidateDataProperties.IsWithinRange(falseObject, minValue, maxValue, false)); }
public void ShouldReturnFalseForString() { string testValue = "Some text"; Assert.IsFalse(ValidateDataProperties.IsWithinRange(testValue, minValue, maxValue, false)); }