Ejemplo n.º 1
0
        public void Setup()
        {
            this.wrappedBuilder = A.Fake <RuleBuilder>(x => x.WithArgumentsForConstructor(() =>
                                                                                          new RuleBuilder(A.Fake <BuildableCallRule>(), A.Fake <FakeManager>(), c => A.Fake <IFakeAsserter>())));

            this.rule = A.Fake <RecordedCallRule>();

            this.builder = new RecordingRuleBuilder(this.rule, this.wrappedBuilder);
        }
Ejemplo n.º 2
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);
            };
        }
Ejemplo n.º 3
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);
            };
        }
Ejemplo n.º 4
0
        private static RecordingCallRule <TFake> CreateRecordingRule <TFake>(RecordedCallRule recordedRule, FakeObject fakeObject)
        {
            var factory = ServiceLocator.Current.Resolve <IRecordingCallRuleFactory>();

            return(factory.Create <TFake>(fakeObject, recordedRule));
        }
Ejemplo n.º 5
0
        private static RuleBuilder CreateBuilder(RecordedCallRule rule)
        {
            var factory = ServiceLocator.Current.Resolve <RuleBuilder.Factory>();

            return(factory.Invoke(rule));
        }
Ejemplo n.º 6
0
 public RecordingCallRule <TFake> Create <TFake>(FakeObject fakeObject, RecordedCallRule recordedRule)
 {
     return(new RecordingCallRule <TFake>(fakeObject, recordedRule, this.Container.Resolve <FakeAsserter.Factory>()));
 }
Ejemplo n.º 7
0
 public RecordingCallRule(FakeObject fakeObject, RecordedCallRule recordedRule, FakeAsserter.Factory asserterFactory)
 {
     this.fakeObject      = fakeObject;
     this.recordedRule    = recordedRule;
     this.asserterFactory = asserterFactory;
 }
Ejemplo n.º 8
0
        private static RecordingRuleBuilder CreateBuilder(RecordedCallRule rule, FakeManager fakeObject)
        {
            var factory = ServiceLocator.Current.Resolve <RecordingRuleBuilder.Factory>();

            return(factory.Invoke(rule, fakeObject));
        }
Ejemplo n.º 9
0
 public RecordingCallRule(FakeObject fakeObject)
 {
     this.fakeObject   = fakeObject;
     this.RecordedRule = new RecordedCallRule();
 }