public void when_empty_string_set_as_id_it_should_fail() { var configurator = new IngressApiConfigurator(new IngressApiConfiguration()); Action sut = () => configurator.WithId(string.Empty); sut.Should().Throw <ArgumentNullException>(); }
public void when_enter_pipe_fitter_set_it_should_be_set_in_configuration() { var configuration = new IngressApiConfiguration(); var sut = new IngressApiConfigurator(configuration); sut.WithPipeFitter <StabPipeFitter>().Should().BeSameAs(sut); configuration.PipeFitterType.Should().Be <StabPipeFitter>(); }
public void when_payload_type_set_it_should_be_set_in_configuration() { var configuration = new IngressApiConfiguration(); var sut = new IngressApiConfigurator(configuration); sut.WithMessagePayload <string>().Should().BeSameAs(sut); configuration.MessagePayloadType.Should().Be <string>(); }
public void when_key_type_set_it_should_be_set_in_configuration() { var configuration = new IngressApiConfiguration(); var sut = new IngressApiConfigurator(configuration); sut.WithMessageKey <int>().Should().BeSameAs(sut); configuration.MessageKeyType.Should().Be <int>(); }
public void when_whitespace_string_set_as_id_it_should_fail() { var configurator = new IngressApiConfigurator(new IngressApiConfiguration()); // ReSharper disable once AssignNullToNotNullAttribute - it's a test against null. Action sut = () => configurator.WithId(" \n\t"); sut.Should().Throw <ArgumentNullException>(); }
public void when_message_type_registry_set_it_should_be_set_in_configuration() { var configuration = new IngressApiConfiguration(); var sut = new IngressApiConfigurator(configuration); sut.WithMessageTypesRegistry <MessageTypesRegistry1>().Should().BeSameAs(sut); configuration.MessageTypesRegistryType.Should().Be <MessageTypesRegistry1>(); }
public void when_queue_name_patterns_provider_set_it_should_be_set_in_configuration() { var configuration = new IngressApiConfiguration(); var sut = new IngressApiConfigurator(configuration); sut.WithQueueNamePatternsProvider <QueueNamePatternsProvider>().Should().BeSameAs(sut); configuration.QueueNamePatternsProviderType.Should().Be <QueueNamePatternsProvider>(); }
public void when_handler_registry_set_it_should_be_set_in_configuration() { var configuration = new IngressApiConfiguration(); var sut = new IngressApiConfigurator(configuration); sut.WithHandlerRegistry <HandlerRegistry>().Should().BeSameAs(sut); configuration.HandlerRegistryType.Should().Be <HandlerRegistry>(); }
public void when_id_set_it_should_be_set_in_configuration() { var configuration = new IngressApiConfiguration(); var sut = new IngressApiConfigurator(configuration); const string expected = "id"; sut.WithId(expected).Should().BeSameAs(sut); configuration.Id.Should().Be(expected); }
public void when_pipe_fitter_set_more_than_once_it_should_fail() { var configuration = new IngressApiConfiguration(); var configurator = new IngressApiConfigurator(configuration); Action sut = () => configurator.WithPipeFitter <StabPipeFitter>(); sut.Should().NotThrow(); configuration.PipeFitterType.Should().Be <StabPipeFitter>(); EnsureSecondCallOfConfigurationMethodFails(sut); }
public void when_payload_type_set_more_than_once_it_should_fail() { var configuration = new IngressApiConfiguration(); var configurator = new IngressApiConfigurator(configuration); Action sut = () => configurator.WithMessagePayload <string>(); sut.Should().NotThrow(); configuration.MessagePayloadType.Should().Be <string>(); EnsureSecondCallOfConfigurationMethodFails(sut); }
public void when_message_type_registry_set_more_than_once_it_should_fail() { var configuration = new IngressApiConfiguration(); var configurator = new IngressApiConfigurator(configuration); Action sut = () => configurator.WithMessageTypesRegistry <MessageTypesRegistry1>(); sut.Should().NotThrow(); configuration.MessageTypesRegistryType.Should().Be <MessageTypesRegistry1>(); EnsureSecondCallOfConfigurationMethodFails(sut); }
public void when_queue_name_patterns_provider_set_more_than_once_it_should_fail() { var configuration = new IngressApiConfiguration(); var configurator = new IngressApiConfigurator(configuration); Action sut = () => configurator.WithQueueNamePatternsProvider <QueueNamePatternsProvider>(); sut.Should().NotThrow(); configuration.QueueNamePatternsProviderType.Should().Be <QueueNamePatternsProvider>(); EnsureSecondCallOfConfigurationMethodFails(sut); }
public void when_id_set_more_than_once_it_should_fail() { var configuration = new IngressApiConfiguration(); var configurator = new IngressApiConfigurator(configuration); const string expected = "id"; Action sut = () => configurator.WithId(expected); sut.Should().NotThrow(); configuration.Id.Should().Be(expected); EnsureSecondCallOfConfigurationMethodFails(sut); }