internal MessagingHubConnection( TimeSpan sendTimeout, int maxConnectionRetries, IOnDemandClientChannelFactory onDemandClientChannelFactory, int channelCount) { _semaphore = new SemaphoreSlim(1); MaxConnectionRetries = maxConnectionRetries; SendTimeout = sendTimeout; _onDemandClientChannelFactory = onDemandClientChannelFactory; _channelCount = channelCount; }
private void SubstituteOnDemandClientChannelFactory() { OnDemandClientChannelFactory = Substitute.For <IOnDemandClientChannelFactory>(); OnDemandClientChannelFactory.ChannelBuilder.Returns(EstablishedClientChannelBuilder); OnDemandClientChannelFactory.Create(1).Returns(OnDemandClientChannel); }