Beispiel #1
0
        public static ValidateTarget <double> IsNaN([ValidatedNotNull] this ValidateTarget <double> target, Func <string> getErrorMessage = null)
        {
            if (!double.IsNaN(target.Value))
            {
                ExceptionFactory.ThrowException(target.Traits.OutOfRangeExceptionType, getErrorMessage != null ? getErrorMessage.Invoke() : ErrorMessageFactory.ShouldBeNaN(target));
            }

            return(target);
        }