private void OnSetUp() { this.configurationFactory = A.Fake<IConfigurationFactory>(); this.expressionParser = A.Fake<IExpressionParser>(); this.callExpressionParser = new CallExpressionParser(); this.interceptionAsserter = A.Fake<IInterceptionAsserter>(); Expression<Action<IFoo>> dummyExpression = x => x.Bar(); this.ruleReturnedFromFactory = ServiceLocator.Current.Resolve<ExpressionCallRule.Factory>().Invoke(dummyExpression); this.ruleFactory = x => { return this.ruleReturnedFromFactory; }; this.fakeObjectReturnedFromParser = new FakeManager(); A.CallTo(() => this.expressionParser.GetFakeManagerCallIsMadeOn(A<LambdaExpression>._)).ReturnsLazily(x => this.fakeObjectReturnedFromParser); this.configurationManager = this.CreateManager(); }
private void OnSetup() { this.configurationFactory = A.Fake<IConfigurationFactory>(); this.callExpressionParser = new CallExpressionParser(); this.interceptionAsserter = A.Fake<IInterceptionAsserter>(); Expression<Action<IFoo>> dummyExpression = x => x.Bar(); var parsedDummyExpression = this.callExpressionParser.Parse(dummyExpression); this.ruleReturnedFromFactory = ServiceLocator.Current.Resolve<ExpressionCallRule.Factory>().Invoke(parsedDummyExpression); this.ruleFactory = x => this.ruleReturnedFromFactory; this.configurationManager = this.CreateManager(); }