private SubstitutionContext() { ThreadContext = new ThreadLocalContext(); var callSpecificationFactory = CallSpecificationFactoryFactoryYesThatsRight.CreateCallSpecFactory(); _callRouterResolver = new CallRouterResolver(); var sequenceNumberGenerator = new SequenceNumberGenerator(); #pragma warning disable 618 // Obsolete SequenceNumberGenerator = sequenceNumberGenerator; #pragma warning restore 618 // Obsolete RouteFactory = new RouteFactory(sequenceNumberGenerator, ThreadContext, callSpecificationFactory); var callInfoFactory = new CallInfoFactory(); var autoValueProvidersFactory = new AutoValueProvidersFactory(); var substituteStateFactory = new SubstituteStateFactory(callSpecificationFactory, callInfoFactory, autoValueProvidersFactory); var callRouterFactory = new CallRouterFactory(ThreadContext, RouteFactory); var argSpecificationQueue = new ArgumentSpecificationDequeue(ThreadContext.DequeueAllArgumentSpecifications); var dynamicProxyFactory = new CastleDynamicProxyFactory(argSpecificationQueue); var delegateFactory = new DelegateProxyFactory(dynamicProxyFactory); var proxyFactory = new ProxyFactory(delegateFactory, dynamicProxyFactory); SubstituteFactory = new SubstituteFactory(substituteStateFactory, callRouterFactory, proxyFactory); }
public CallRouter(ISubstituteState substituteState, IThreadLocalContext threadContext, IRouteFactory routeFactory, bool canConfigureBaseCalls) { _substituteState = substituteState; _threadContext = threadContext; _routeFactory = routeFactory; _canConfigureBaseCalls = canConfigureBaseCalls; }
public CallRouter(ISubstituteState substituteState, IThreadLocalContext threadContext, IRouteFactory routeFactory) { _substituteState = substituteState; _threadContext = threadContext; _routeFactory = routeFactory; UseDefaultRouteForNextCall(); }
public WhenCalled(ISubstitutionContext context, T substitute, Action <T> call, MatchArgs matchArgs) { _substitute = substitute; _call = call; _matchArgs = matchArgs; _callRouter = context.GetCallRouterFor(substitute !); _routeFactory = context.RouteFactory; _threadContext = context.ThreadContext; }
public SubstitutionContext(ISubstituteFactory substituteFactory, IRouteFactory routeFactory, IThreadLocalContext threadLocalContext, ICallRouterResolver callRouterResolver) { SubstituteFactory = substituteFactory ?? throw new ArgumentNullException(nameof(substituteFactory)); RouteFactory = routeFactory ?? throw new ArgumentNullException(nameof(routeFactory)); ThreadContext = threadLocalContext ?? throw new ArgumentNullException(nameof(threadLocalContext)); _callRouterResolver = callRouterResolver ?? throw new ArgumentNullException(nameof(callRouterResolver)); #pragma warning disable 618 // Obsolete SequenceNumberGenerator = new SequenceNumberGenerator(); #pragma warning restore 618 // Obsolete }
public RouteFactory(SequenceNumberGenerator sequenceNumberGenerator, IThreadLocalContext threadLocalContext, ICallSpecificationFactory callSpecificationFactory, IReceivedCallsExceptionThrower receivedCallsExceptionThrower, IPropertyHelper propertyHelper, IDefaultForType defaultForType) { _sequenceNumberGenerator = sequenceNumberGenerator; _threadLocalContext = threadLocalContext; _callSpecificationFactory = callSpecificationFactory; _receivedCallsExceptionThrower = receivedCallsExceptionThrower; _propertyHelper = propertyHelper; _defaultForType = defaultForType; }
public RouteFactory(SequenceNumberGenerator sequenceNumberGenerator, IThreadLocalContext threadLocalContext, ICallSpecificationFactory callSpecificationFactory, IReceivedCallsExceptionThrower receivedCallsExceptionThrower, IPropertyHelper propertyHelper, IDefaultForType defaultForType) { _sequenceNumberGenerator = sequenceNumberGenerator ?? throw new ArgumentNullException(nameof(sequenceNumberGenerator)); _threadLocalContext = threadLocalContext ?? throw new ArgumentNullException(nameof(threadLocalContext)); _callSpecificationFactory = callSpecificationFactory ?? throw new ArgumentNullException(nameof(callSpecificationFactory)); _receivedCallsExceptionThrower = receivedCallsExceptionThrower ?? throw new ArgumentNullException(nameof(receivedCallsExceptionThrower)); _propertyHelper = propertyHelper ?? throw new ArgumentNullException(nameof(propertyHelper)); _defaultForType = defaultForType ?? throw new ArgumentNullException(nameof(defaultForType)); }
public SubstitutionContext(ISubstituteFactory substituteFactory, IRouteFactory routeFactory, ICallSpecificationFactory callSpecificationFactory, IThreadLocalContext threadLocalContext, ICallRouterResolver callRouterResolver, SequenceNumberGenerator sequenceNumberGenerator) { SubstituteFactory = substituteFactory; RouteFactory = routeFactory; CallSpecificationFactory = callSpecificationFactory; ThreadContext = threadLocalContext; _callRouterResolver = callRouterResolver; #pragma warning disable 618 // Obsolete SequenceNumberGenerator = sequenceNumberGenerator; #pragma warning restore 618 // Obsolete }
public DiagnosticsThreadLocalContext(IThreadLocalContext impl, DiagContextInternal ctx) { _impl = impl; _ctx = ctx; PendingSpecification = new DiagnosticsPendingSpecification(impl.PendingSpecification, ctx); }
public CallRouterFactory(IThreadLocalContext threadLocalContext, IRouteFactory routeFactory) { _threadLocalContext = threadLocalContext; _routeFactory = routeFactory; }
public RouteFactory(IThreadLocalContext threadLocalContext, ICallSpecificationFactory callSpecificationFactory) { _threadLocalContext = threadLocalContext ?? throw new ArgumentNullException(nameof(threadLocalContext)); _callSpecificationFactory = callSpecificationFactory ?? throw new ArgumentNullException(nameof(callSpecificationFactory)); }
public CallRouterFactory(IThreadLocalContext threadLocalContext, IRouteFactory routeFactory) { _threadLocalContext = threadLocalContext ?? throw new ArgumentNullException(nameof(threadLocalContext)); _routeFactory = routeFactory ?? throw new ArgumentNullException(nameof(routeFactory)); }
public ClearLastCallRouterHandler(IThreadLocalContext threadContext) { _threadContext = threadContext; }
public AddCallToQueryResultHandler(IThreadLocalContext threadContext) { _threadContext = threadContext; }
public RouteFactory(SequenceNumberGenerator sequenceNumberGenerator, IThreadLocalContext threadLocalContext, ICallSpecificationFactory callSpecificationFactory) { _sequenceNumberGenerator = sequenceNumberGenerator ?? throw new ArgumentNullException(nameof(sequenceNumberGenerator)); _threadLocalContext = threadLocalContext ?? throw new ArgumentNullException(nameof(threadLocalContext)); _callSpecificationFactory = callSpecificationFactory ?? throw new ArgumentNullException(nameof(callSpecificationFactory)); }