コード例 #1
0
 public FakeConfigurationManager(IConfigurationFactory configurationFactory, ExpressionCallRule.Factory callRuleFactory, ICallExpressionParser callExpressionParser, IInterceptionAsserter interceptionAsserter)
 {
     this.configurationFactory = configurationFactory;
     this.ruleFactory          = callRuleFactory;
     this.callExpressionParser = callExpressionParser;
     this.interceptionAsserter = interceptionAsserter;
 }
コード例 #2
0
 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;
 }
コード例 #3
0
        private void OnSetup()
        {
            this.configurationFactory = A.Fake <IConfigurationFactory>();
            this.callExpressionParser = new CallExpressionParser();
            this.interceptionAsserter = A.Fake <IInterceptionAsserter>();

            this.ruleFactory = x => null;

            this.configurationManager = this.CreateManager();
        }
コード例 #4
0
ファイル: RootModule.cs プロジェクト: alex-valchuk/FakeItEasy
 public StartConfigurationFactory(
     ExpressionCallRule.Factory expressionCallRuleFactory,
     IConfigurationFactory configurationFactory,
     ICallExpressionParser callExpressionParser,
     IInterceptionAsserter interceptionAsserter)
 {
     this.expressionCallRuleFactory = expressionCallRuleFactory;
     this.configurationFactory      = configurationFactory;
     this.callExpressionParser      = callExpressionParser;
     this.interceptionAsserter      = interceptionAsserter;
 }
コード例 #5
0
        public FakeConfigurationManagerTests()
        {
            this.configurationFactory = A.Fake <IConfigurationFactory>();
            this.callExpressionParser = new CallExpressionParser();
            this.interceptionAsserter = A.Fake <IInterceptionAsserter>();

            ExpressionCallRule.Factory ruleFactory = A.Dummy <ExpressionCallRule.Factory>();

            this.configurationManager = new FakeConfigurationManager(
                this.configurationFactory,
                ruleFactory,
                this.callExpressionParser,
                this.interceptionAsserter);
        }
コード例 #6
0
        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();
        }
コード例 #7
0
        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>();
        }
コード例 #8
0
        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 = A.Fake <FakeManager>(o => o.CallsBaseMethods());

            A.CallTo(() => this.expressionParser.GetFakeManagerCallIsMadeOn(A <LambdaExpression> ._)).ReturnsLazily(x => this.fakeObjectReturnedFromParser);

            this.configurationManager = this.CreateManager();
        }
コード例 #9
0
        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();
        }
コード例 #10
0
        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();
        }