public void TestSetup() { log = new ConsoleLog(); configuration = new ClusterClientConfiguration(log) { Transport = Substitute.For <ITransport>(), ClusterProvider = Substitute.For <IClusterProvider>() }; }
public void Should_respect_removed_built_in_modules_when_building_a_chain() { var config = new ClusterClientConfiguration(new SilentLog()); config.RemoveRequestModule(RequestModule.AbsoluteUrlSender); var chain = RequestModuleChainBuilder.BuildChain(config, Substitute.For <IReplicaStorageProvider>()); chain.Should().NotContain(module => module is AbsoluteUrlSenderModule); }
public void Should_respect_removed_custom_modules_when_building_a_chain() { var config = new ClusterClientConfiguration(new SilentLog()); config.SetupThreadPoolLimitsTuning(); config.RemoveRequestModule(RequestModule.ThreadPoolTuning); var chain = RequestModuleChainBuilder.BuildChain(config, Substitute.For <IReplicaStorageProvider>()); chain.Should().NotContain(module => module is ThreadPoolTuningModule); }
public void Members_of_RequestModules_should_be_ordered_in_pipeline_order() { var configuration = new ClusterClientConfiguration(new SilentLog()); configuration.TargetServiceName = string.Empty; configuration.SetupAdaptiveThrottling(); configuration.SetupReplicaBudgeting(); configuration.SetupHttpMethodValidation(); configuration.SetupThreadPoolLimitsTuning(); var chain = RequestModuleChainBuilder.BuildChain(configuration, new PerInstanceReplicaStorageProvider()); var values = (RequestModule[])Enum.GetValues(typeof(RequestModule)); values.Should().HaveCount(chain.Count); for (var i = 0; i < values.Length; i++) { RequestModulesMapping.GetModuleType(values[i]).Should().Be(chain[i].GetType()); } }
public void Should_initially_have_null_cluster_provider() { configuration = new ClusterClientConfiguration(log); configuration.ClusterProvider.Should().BeNull(); }
public void Should_initially_have_null_transport() { configuration = new ClusterClientConfiguration(log); configuration.Transport.Should().BeNull(); }
public void TestSetup() { configuration = new ClusterClientConfiguration(new ConsoleLog()); }