PowerAssert.Infrastructure.ExpressionParser.GetValue C# (CSharp) Method

GetValue() private method

private GetValue ( Expression e ) : string
e System.Linq.Expressions.Expression
return string
        string GetValue(Expression e)
        {
            object value;
            try
            {
                if (e is ConstantExpression)
                {
                    value = ((ConstantExpression)e).Value;
                }
                else if (TextOnly)
                {
                    return null; // Return immediately (Don't apply ObjectFormatter)
                }
                else
                {
                    value = DynamicInvoke(e);
                }
            }
            catch (TargetInvocationException exception)
            {
                return ObjectFormatter.FormatTargetInvocationException(exception);
            }
            var s = ObjectFormatter.FormatObject(value);
            return s + GetHints(e, value);
        }