Example #1
0
        public void CanCreateEmptyHeadersFromAmqpProperties()
        {
            IAmqpProperties properties = A.Fake <IAmqpProperties>();
            var             sut        = new AmqpPropertyBuilder();

            IDictionary <string, string> headers = sut.BuildHeadersFromProperties(properties);

            headers.Should().NotBeNull(because: "Builder can build empty headers");
        }
Example #2
0
        public void CanCreateHeadersWithReplyToFromAmqpProperties()
        {
            IAmqpProperties properties  = A.Fake <IAmqpProperties>();
            const string    headerValue = "some address";

            A.CallTo(() => properties.ReplyTo).Returns(headerValue);

            var sut = new AmqpPropertyBuilder();

            IDictionary <string, string> headers = sut.BuildHeadersFromProperties(properties);

            headers.Should().Contain(new KeyValuePair <string, string>(AmqpPropertyBuilder.ReplyTo, headerValue));

            headers.Should().NotBeNull(because: "builder can build correlation id from AmqpProperties");
        }
Example #3
0
        public void CanCreateHeadersWithContentTypeFromAmqpProperties()
        {
            IAmqpProperties properties  = A.Fake <IAmqpProperties>();
            const string    headerValue = "text/plain";

            A.CallTo(() => properties.ContentType).Returns(headerValue);

            var sut = new AmqpPropertyBuilder();

            IDictionary <string, string> headers = sut.BuildHeadersFromProperties(properties);

            headers.Should().Contain(new KeyValuePair <string, string>(AmqpPropertyBuilder.ContentType, headerValue));

            headers.Should().NotBeNull(because: "builder can build content type from AmqpProperties");
        }