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(FakeObject fakeObject, ExpressionCallRule.Factory callRuleFactory, IConfigurationFactory configurationFactory, IProxyGenerator proxyGenerator)
 {
     this.fakeObject           = fakeObject;
     this.callRuleFactory      = callRuleFactory;
     this.configurationFactory = configurationFactory;
     this.proxyGenerator       = proxyGenerator;
 }
Пример #3
0
 public FakeConfigurationManager(IConfigurationFactory configurationFactory, IExpressionParser parser, ExpressionCallRule.Factory callRuleFactory, IProxyGenerator proxyGenerator)
 {
     this.configurationFactory = configurationFactory;
     this.expressionParser     = parser;
     this.ruleFactory          = callRuleFactory;
     this.proxyGenerator       = proxyGenerator;
 }
Пример #4
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;
 }
Пример #5
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();
        }
Пример #6
0
 public StartConfigurationFactory(
     ExpressionCallRule.Factory expressionCallRuleFactory,
     IConfigurationFactory configurationFactory,
     ICallExpressionParser callExpressionParser,
     IInterceptionAsserter interceptionAsserter)
 {
     this.expressionCallRuleFactory = expressionCallRuleFactory;
     this.configurationFactory      = configurationFactory;
     this.callExpressionParser      = callExpressionParser;
     this.interceptionAsserter      = interceptionAsserter;
 }
Пример #7
0
        protected virtual void OnSetUp()
        {
            this.fake = new FakeObject(typeof(IFoo));
            this.expressionRuleFactory = x =>
            {
                var result = new ExpressionCallRule(new ExpressionCallMatcher(x, A.Fake <ArgumentValidatorFactory>(), A.Fake <MethodInfoManager>()));
                this.ruleProducedByFactory = result;
                return(result);
            };

            this.configuration = this.CreateConfiguration();
        }
Пример #8
0
        protected virtual void OnSetUp()
        {
            this.fakeObject  = new FakeObject();
            this.rule        = ExpressionHelper.CreateRule <IFoo>(x => x.Bar());
            this.ruleFactory = x =>
            {
                this.argumentToRuleFactory = x;
                return(this.rule);
            };

            this.configurationFactory = A.Fake <IConfigurationFactory>();
        }
        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);
        }
        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();
        }
        protected virtual void OnSetUp()
        {
            this.fakeObject  = new FakeObject();
            this.rule        = ExpressionHelper.CreateRule <IFoo>(x => x.Bar());
            this.ruleFactory = x =>
            {
                this.argumentToRuleFactory = x;
                return(this.rule);
            };

            this.configurationFactory = A.Fake <IConfigurationFactory>();

            this.proxyGenerator = A.Fake <IProxyGenerator>();
            A.CallTo(() => this.proxyGenerator.MemberCanBeIntercepted(A <MemberInfo> .Ignored)).Returns(true);
        }
Пример #12
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>();
        }
        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();
        }
        private void OnSetUp()
        {
            this.configurationFactory = A.Fake <IConfigurationFactory>();
            this.expressionParser     = A.Fake <IExpressionParser>();
            this.proxyGenerator       = A.Fake <IProxyGenerator>();
            A.CallTo(() => this.proxyGenerator.MemberCanBeIntercepted(A <MemberInfo> .Ignored)).Returns(true);

            this.callSpecification = ExpressionHelper.CreateExpression <IFoo>(x => x.Bar());

            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 FakeObject();

            A.CallTo(() => this.expressionParser.GetFakeObjectCallIsMadeOn(A <LambdaExpression> .Ignored)).Returns(x => this.fakeObjectReturnedFromParser);

            this.configurationManager = this.CreateManager();
        }
Пример #15
0
 internal StartConfiguration(FakeObject fakeObject, ExpressionCallRule.Factory callRuleFactory, IConfigurationFactory configurationFactory)
 {
     this.fakeObject           = fakeObject;
     this.callRuleFactory      = callRuleFactory;
     this.configurationFactory = configurationFactory;
 }
Пример #16
0
 internal FakeConfiguration(FakeObject fake, ExpressionCallRule.Factory expressionRuleFactory)
 {
     this.Fake = fake;
     this.expressionRuleFactory = expressionRuleFactory;
 }
        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();
        }