public async Task Should_set_content_type_header()
        {
            var registry = new MessageMetadataRegistry(new Conventions());

            registry.RegisterMessageTypesFoundIn(new List<Type>
            {
                typeof(MyMessage)
            });

            var context = new TestableOutgoingLogicalMessageContext();
            context.Message = new OutgoingLogicalMessage(typeof(MyMessage), new MyMessage());

            var behavior = new SerializeMessageConnector(new FakeSerializer("myContentType"), registry);

            await behavior.Invoke(context, c => TaskEx.CompletedTask);

            Assert.AreEqual("myContentType", context.Headers[Headers.ContentType]);
        }
        public async Task Should_set_content_type_header()
        {
            var registry = new MessageMetadataRegistry(new Conventions().IsMessageType);

            registry.RegisterMessageTypesFoundIn(new List <Type>
            {
                typeof(MyMessage)
            });

            var context = new TestableOutgoingLogicalMessageContext();

            context.Message = new OutgoingLogicalMessage(typeof(MyMessage), new MyMessage());

            var behavior = new SerializeMessageConnector(new FakeSerializer("myContentType"), registry);

            await behavior.Invoke(context, c => Task.CompletedTask);

            Assert.AreEqual("myContentType", context.Headers[Headers.ContentType]);
        }