Exemplo n.º 1
0
        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>();
        }
Exemplo n.º 2
0
        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>();
        }
Exemplo n.º 3
0
        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>();
        }
Exemplo n.º 4
0
        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>();
        }
Exemplo n.º 5
0
        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>();
        }
Exemplo n.º 6
0
        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>();
        }
Exemplo n.º 7
0
        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>();
        }
Exemplo n.º 8
0
        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>();
        }
Exemplo n.º 9
0
        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);
        }
Exemplo n.º 10
0
        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);
        }
Exemplo n.º 11
0
        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);
        }
Exemplo n.º 12
0
        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);
        }
Exemplo n.º 13
0
        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);
        }
Exemplo n.º 14
0
        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);
        }