Esempio n. 1
0
        public void SetUp()
        {
            this.fake = Fake.GetFakeObject(ServiceLocator.Current.Resolve <FakeObjectFactory>().CreateFake(typeof(IFoo), null, false));

            this.fakeAsserter = A.Fake <FakeAsserter>();

            this.matcher = A.Fake <ExpressionCallMatcher>(() =>
                                                          new ExpressionCallMatcher(
                                                              ExpressionHelper.CreateExpression <IFoo>(x => Console.WriteLine("")),
                                                              ServiceLocator.Current.Resolve <ArgumentValidatorFactory>(),
                                                              ServiceLocator.Current.Resolve <MethodInfoManager>()));

            this.callMatcherFactory = A.Fake <IExpressionCallMatcherFactory>();
            A.CallTo(() => this.callMatcherFactory.CreateCallMathcer(A <LambdaExpression> .Ignored)).Returns(() => this.matcher);

            this.fakeAsserterFactory = x =>
            {
                this.argumentToFakeAsserterFactory = x;
                return(this.fakeAsserter);
            };

            this.assertions = new FakeAssertions <IFoo>(this.fake, this.callMatcherFactory, this.fakeAsserterFactory);

            this.FakedFoo.Bar();
            this.FakedFoo.Baz();
        }
Esempio n. 2
0
        public void SetUp()
        {
            this.fake = new FakeObject(typeof(IFoo));

            this.fakeAsserter = A.Fake <FakeAsserter>(() => new FakeAsserter(new List <IFakeObjectCall>()));

            this.matcher = A.Fake <ExpressionCallMatcher>(() =>
                                                          new ExpressionCallMatcher(
                                                              ExpressionHelper.CreateExpression <IFoo>(x => Console.WriteLine("")),
                                                              ServiceLocator.Current.Resolve <ArgumentValidatorFactory>(),
                                                              ServiceLocator.Current.Resolve <MethodInfoManager>()));

            this.callMatcherFactory = x =>
            {
                this.argumentToCallMatcherFactory = x;
                return(this.matcher);
            };

            this.fakeAsserterFactory = x =>
            {
                this.argumentToFakeAsserterFactory = x;
                return(this.fakeAsserter);
            };

            this.assertions = new FakeAssertions <IFoo>(this.fake, this.callMatcherFactory, this.fakeAsserterFactory);

            this.FakedFoo.Bar();
            this.FakedFoo.Baz();
        }
Esempio n. 3
0
        protected virtual void OnSetUp()
        {
            this.ruleProducedByFactory = A.Fake <BuildableCallRule>();
            this.fakeObject            = new FakeObject();
            this.asserter = A.Fake <FakeAsserter>();

            this.builder = this.CreateBuilder();
        }
Esempio n. 4
0
        public void SetUp()
        {
            this.fakedObject  = A.Fake <IFoo>();
            this.fakeObject   = Fake.GetFakeObject(fakedObject);
            this.recordedRule = A.Fake <RecordedCallRule>(x => x.WithArgumentsForConstructor(() => new RecordedCallRule(A.Fake <MethodInfoManager>())));

            this.asserter = A.Fake <FakeAsserter>();

            this.asserterFactory = x =>
            {
                this.argumentUsedForAsserterFactory = x;
                return(this.asserter);
            };
        }
Esempio n. 5
0
        public void SetUp()
        {
            this.fakedObject  = A.Fake <IFoo>();
            this.fakeObject   = Fake.GetFakeObject(fakedObject);
            this.recordedRule = A.Fake <RecordedCallRule>(() => new RecordedCallRule(A.Fake <MethodInfoManager>()));

            this.asserter = A.Fake <FakeAsserter>(() => new FakeAsserter(Enumerable.Empty <IFakeObjectCall>()));

            this.asserterFactory = x =>
            {
                this.argumentUsedForAsserterFactory = x;
                return(this.asserter);
            };
        }
 public void SetUp()
 {
     this.fake     = new FakeObject(typeof(IFoo));
     this.asserter = new FakeAsserter <IFoo>(this.fake);
 }
Esempio n. 7
0
 public void SetUp()
 {
     this.callMatcherFactory = ServiceLocator.Current.Resolve <ExpressionCallMatcher.Factory>();
     this.fake     = new FakeObject(typeof(IFoo));
     this.asserter = new FakeAsserter <IFoo>(this.fake, A.Fake <ICallCollectionFactory>(), this.callMatcherFactory);
 }