public override void Context() { _substitute = mock<Foo>(); _substituteFactory = mock<ISubstituteFactory>(); _substituteFactory.stub(x => x.Create<Foo>()).Return(_substitute); _context = mock<ISubstitutionContext>(); _context.stub(x => x.GetSubstituteFactory()).Return(_substituteFactory); temporarilyChange(() => SubstitutionContext.Current).to(_context); }
SubstitutionContext() { var callRouterFactory = new CallRouterFactory(); var dynamicProxyFactory = new CastleDynamicProxyFactory(); var delegateFactory = new DelegateProxyFactory(); var proxyFactory = new ProxyFactory(delegateFactory, dynamicProxyFactory); var callRouteResolver = new CallRouterResolver(); _substituteFactory = new SubstituteFactory(this, callRouterFactory, proxyFactory, callRouteResolver); }
SubstitutionContext() { var callRouterFactory = new CallRouterFactory(); var interceptorFactory = new CastleInterceptorFactory(); var dynamicProxyFactory = new CastleDynamicProxyFactory(interceptorFactory); var delegateFactory = new DelegateProxyFactory(); var proxyFactory = new ProxyFactory(delegateFactory, dynamicProxyFactory); var callRouteResolver = new CallRouterResolver(); _substituteFactory = new SubstituteFactory(this, callRouterFactory, proxyFactory, callRouteResolver); _argumentSpecifications = new List<IArgumentSpecification>(); }
public override void Context() { _types = new[] { typeof(Foo) }; _constructorArgs = new[] { new object() }; _substitute = mock<Foo>(); _substituteFactory = mock<ISubstituteFactory>(); _substituteFactory.stub(x => x.Create(_types, _constructorArgs)).Return(_substitute); _context = mock<ISubstitutionContext>(); _context.stub(x => x.GetSubstituteFactory()).Return(_substituteFactory); temporarilyChange(() => SubstitutionContext.Current).to(_context); }
public override void Context() { substitute = mock<Foo>(); substituteFactory = mock<ISubstituteFactory>(); substituteFactory.stub(x => x.Create<Foo>()).Return(substitute); context = mock<ISubstitutionContext>(); context.stub(x => x.GetSubstituteFactory()).Return(substituteFactory); temporarilyChange(SubstitutionContext.Current) .to(context) .via(x => SubstitutionContext.Current = x); }
public FluentQuerySubstitutionContext(ISubstitutionContext innerContext) { this.innerContext = innerContext; var callRouterFactory = new FluentCallRouterFactory(); var dynamicProxyFactory = new CastleDynamicProxyFactory(); var delegateFactory = new DelegateProxyFactory(); var proxyFactory = new ProxyFactory(delegateFactory, dynamicProxyFactory); var callRouteResolver = new CallRouterResolver(); this.substituteFactory = new SubstituteFactory(this, callRouterFactory, proxyFactory, callRouteResolver); }
public SubstitutionContext(ISubstituteFactory substituteFactory) { _substituteFactory = substituteFactory; }
public AutoSubstituteProvider(ISubstituteFactory substituteFactory) { _substituteFactory = substituteFactory; }
public override void Context() { _substituteFactory = mock <ISubstituteFactory>(); }
public void Setup() { this.SubstituteFactory = Substitute.For <ISubstituteFactory>(); this.Target = new SubstituteService(new[] { this.SubstituteFactory }); }