Beispiel #1
0
 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}.");
     }
 }
Beispiel #2
0
 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);
     }
 }