Esempio n. 1
0
        internal static InvalidOperationException DidNotFailException <TValue>(IFailableFunc <TValue> failableFunc, Optional <TValue> actualValue)
        {
            var msg = DidNotFailMessage(failableFunc);

            if (actualValue.HasValue)
            {
                msg += $"({nameof(actualValue)}: {actualValue})";
            }

            throw new InvalidOperationException(msg);
        }
Esempio n. 2
0
 internal static InvalidOperationException FailedException <TValue>([NotNull] IFailableFunc <TValue> failableFunc, Optional <Exception> actualExcuse)
 {
     return(new InvalidOperationException($"Unable to retrieve the {typeof(TValue).Prettify()} {nameof(failableFunc.Value)} from the {failableFunc.GetType().Prettify()} because it failed!", actualExcuse.OrElse(default)));