public void AssertArgument(string paramName, T value) { if (!Contains(value)) { throw new ArgumentOutOfRangeException(paramName, value, $"The value must be between {_lowerBound.ToAssertion()} and {_upperBound.ToAssertion()}. That is, contained within {this}."); } }
public void AssertArgument(string paramName, T value) { if (!Contains(value)) { string message = string.Format(Exceptions.Range_ArgumentAssertion_Template, _lowerBound.ToAssertion(), _upperBound.ToAssertion(), this); throw new ArgumentOutOfRangeException(paramName, value, message); } }