/// <summary> /// Initializes a new instance of the <see cref="ExpressionCallMatcher" /> class. /// </summary> /// <param name="callSpecification">The call specification.</param> /// <param name="constraintFactory">The constraint factory.</param> /// <param name="methodInfoManager">The method info manager to use.</param> /// <param name="callExpressionParser">A parser to use to parse call expressions.</param> public ExpressionCallMatcher(LambdaExpression callSpecification, ExpressionArgumentConstraintFactory constraintFactory, MethodInfoManager methodInfoManager, ICallExpressionParser callExpressionParser) { this.methodInfoManager = methodInfoManager; var parsedExpression = callExpressionParser.Parse(callSpecification); this.Method = parsedExpression.CalledMethod; this.argumentConstraints = GetArgumentConstraints(parsedExpression.ArgumentsExpressions, constraintFactory).ToArray(); this.argumentsPredicate = this.ArgumentsMatchesArgumentConstraints; }
protected virtual void OnSetUp() { this.fakeObject = A.Fake <FakeManager>(); this.rule = ExpressionHelper.CreateRule <IFoo>(x => x.Bar()); this.ruleFactory = x => { this.argumentToRuleFactory = x; return(this.rule); }; this.configurationFactory = A.Fake <IConfigurationFactory>(); this.expressionParser = A.Fake <ICallExpressionParser>(); this.interceptionAsserter = A.Fake <IInterceptionAsserter>(); }
public FakeConfigurationManager(IConfigurationFactory configurationFactory, IExpressionParser parser, ExpressionCallRule.Factory callRuleFactory, ICallExpressionParser callExpressionParser, IInterceptionAsserter interceptionAsserter) { this.configurationFactory = configurationFactory; this.expressionParser = parser; this.ruleFactory = callRuleFactory; this.callExpressionParser = callExpressionParser; this.interceptionAsserter = interceptionAsserter; }
public ExpressionParser(ICallExpressionParser innerParser) { this.innerParser = innerParser; }
internal StartConfiguration(FakeManager manager, ExpressionCallRule.Factory callRuleFactory, IConfigurationFactory configurationFactory, ICallExpressionParser expressionParser, IInterceptionAsserter interceptionAsserter) { this.manager = manager; this.callRuleFactory = callRuleFactory; this.configurationFactory = configurationFactory; this.expressionParser = expressionParser; this.interceptionAsserter = interceptionAsserter; }