public override bool checkIsValidOption(AttributeOption option) { AssertionConcerns.AssertArgumentCanBeDouble(option.Value, $"{Reasons.UNPARSEABLE}: Value is not parseable as double {option}"); var val = Double.Parse(option.Value); return(val >= MinValue && val <= MaxValue); }
public ProductAttributeWithContinousValue(string name, AttributeOption minValue, AttributeOption maxValue) : base(name) { AssertionConcerns.AssertArgumentCanBeDouble(minValue.Value, $"{Reasons.UNPARSEABLE}: Value is not parseable as double {minValue}"); AssertionConcerns.AssertArgumentCanBeDouble(maxValue.Value, $"{Reasons.UNPARSEABLE}: Value is not parseable as double {maxValue}"); AttributeOptions = new List <AttributeOption>() { minValue, maxValue }; }