コード例 #1
0
        public void when_set_kafka_driver_without_configurator_it_should_fail()
        {
            var    configuration = new BrokerEgressConfiguration();
            var    configurator  = new BrokerEgressConfigurator(configuration);
            Action sut           = () => configurator.WithKafkaDriver(configurator: null);

            sut.Should().ThrowExactly <ArgumentNullException>();
        }
コード例 #2
0
        public void when_broker_egress_configured_with_kafka_driver_it_should_configure_in_expected_way()
        {
            var configuration = new BrokerEgressConfiguration();
            var configurator  = new BrokerEgressConfigurator(configuration);

            configurator.WithKafkaDriver(
                driver => driver
                .WithProducerConfig(new ProducerConfig())
                .WithDefaultProducerFactory()
                .WithHeaderValueCodec <IHeaderValueCodec>()
                .WithProducerFactory <IApiProducerFactory>()
                .WithSerializerFactory <ISerializerFactory>());

            configuration.Driver.Should().BeOfType <BrokerEgressKafkaDriver>("what it can be else?");
        }