public void AddPreprocessor_Should_Succeed() { var preprocessor1 = new TestReturnNullPreprocessor(); var builder = new HubConfigurationBuilder <TestRoutable>(); HubConfigurationBuilderExtensions.AddPreprocessor <TestRoutable>(builder, preprocessor1); builder.Preprocessors.Should().Contain(preprocessor1); }
public void Constructor_Should_SetProperties() { var router1 = new TestRouter <TestRoutable>(); var routers = new IRouter <TestRoutable>[] { router1 }; var preprocessor1 = new TestReturnNullPreprocessor(); var preprocessors = new IRoutablePreprocessor <TestRoutable>[] { preprocessor1 }; this.prepareConfiguration(routers, preprocessors, out var configuration); configuration.Routers.Should().Contain(routers); configuration.Preprocessors.Should().Contain(preprocessor1); configuration.MaximumRoutablesQueueLength.Should().Be(MaximumRoutablesQueueLengthDefault); }
public void Build_Should_CreateHubConfiguration() { var router1 = new TestRouter <TestRoutable>(); var preprocessor1 = new TestReturnNullPreprocessor(); var builder = new HubConfigurationBuilder <TestRoutable>(); builder.Routers.Add(router1); builder.Preprocessors.Add(preprocessor1); builder.MaximumRoutableQueueLength = 1; builder.MaximumRoutablesForwardingCount = 2; builder.WaitForMoreRoutablesForwardingDelay = TimeSpan.FromMilliseconds(3); var hubConfiguration = builder.Build(); hubConfiguration.Routers.Should().Contain(router1); hubConfiguration.Preprocessors.Should().Contain(preprocessor1); hubConfiguration.MaximumRoutablesQueueLength.Should().Be(1); hubConfiguration.MaximumRoutablesForwardingCount.Should().Be(2); hubConfiguration.WaitForMoreRoutablesForwardingDelay.Should().Be(TimeSpan.FromMilliseconds(3)); }