public void SerializeAsAvro_WithoutType_ExceptionThrown()
        {
            var builder = new TestProducerEndpointBuilder();

            Action act = () => builder.SerializeAsAvro();

            act.Should().Throw <InvalidOperationException>();
        }
        public void SerializeAsAvro_Default_SerializerSet()
        {
            var builder = new TestProducerEndpointBuilder();

            var endpoint = builder.SerializeAsAvro(serializer => serializer.UseType <TestEventOne>())
                           .Build();

            endpoint.Serializer.Should().BeOfType <AvroMessageSerializer <TestEventOne> >();
        }
        public void SerializeAsAvro_Configure_SchemaRegistryAndSerializerConfigSet()
        {
            var builder = new TestProducerEndpointBuilder();

            var endpoint = builder.SerializeAsAvro(
                serializer => serializer
                .UseType <TestEventOne>()
                .Configure(
                    schemaRegistryConfig => { schemaRegistryConfig.Url = "some-url"; },
                    serializerConfig => { serializerConfig.BufferBytes = 42; })).Build();

            endpoint.Serializer.Should().BeOfType <AvroMessageSerializer <TestEventOne> >();
            endpoint.Serializer.As <AvroMessageSerializer <TestEventOne> >().SchemaRegistryConfig.Url.Should()
            .Be("some-url");
            endpoint.Serializer.As <AvroMessageSerializer <TestEventOne> >().AvroSerializerConfig.BufferBytes.Should()
            .Be(42);
        }