public static Matcher <ConstantExpression> ValueIsNull(this Matcher <ConstantExpression> matcher) { return(matcher.Match(c => c.Value == null)); }
public static Matcher <ConstantExpression> Value(this Matcher <ConstantExpression> matcher, Func <object, bool> matchValue) { return(matcher.Match(c => matchValue(c.Value))); }
public static Matcher <ConstantExpression> Value(this Matcher <ConstantExpression> matcher, object value) { return(matcher.Match(c => Equals(c.Value, value))); }
public static Matcher <TExpression> Type <TExpression>(this Matcher <TExpression> matcher, Func <Type, bool> matchType) where TExpression : Expression { return(matcher.Match(target => matchType(target.Type))); }
public static Matcher <TExpression> OneOf <TExpression>(this Matcher <TExpression> matcher, params ExpressionType[] types) where TExpression : Expression { return(matcher.Match(target => types.Contains(target.NodeType))); }
public static Matcher <MethodCallExpression> Argument <TParameter>(this Matcher <MethodCallExpression> matcher, Func <Matcher <Expression>, Matcher> matchArgument) { return(matcher.Match(_ => matchArgument(matcher.Argument <TParameter>()).Matched)); }
public static Matcher <Expression> Argument(this Matcher <MethodCallExpression> matcher, int index) { return(matcher.Match(n => index >= 0 && index <= n.Arguments.Count - 1) .For(n => n.Arguments[index])); }
public static Matcher <ParameterExpression> Name(this Matcher <ParameterExpression> matcher, string name) { return(matcher.Match(target => matcher.Target.Name == name)); }