public void IsValid_ValueOnBorder_ReturnsTrue() { DecimalRangeAttribute attribute = new DecimalRangeAttribute(double.MinValue, double.MaxValue); attribute.IsValid(decimal.MaxValue); }
public void IsValid_ValueInRange_ReturnsTrue() { DecimalRangeAttribute attribute = new DecimalRangeAttribute(2, 2.1); attribute.IsValid(2.15m); }
public void IsValid_ValueOutOfRange_ReturnsFalse() { DecimalRangeAttribute attribute = new DecimalRangeAttribute(2, 2); attribute.IsValid(2.002m); }
public void IsValid_MaxLessThanMin_ThrowsException() { DecimalRangeAttribute attribute = new DecimalRangeAttribute(2.1, 2); attribute.IsValid(2); }
public void IsValid_NotDecimal_ThrowsException() { DecimalRangeAttribute attribute = new DecimalRangeAttribute(0, 2); attribute.IsValid(2); }
public void IsValid_NullObject_ThrowsException() { DecimalRangeAttribute attribute = new DecimalRangeAttribute(0, 1); attribute.IsValid(null); }