public void CanCreateEmptyAmqpPropertiesFromBasicProperites() { IBasicProperties basicProperties = A.Fake <IBasicProperties>(); var sut = new AmqpPropertyBuilder(); IAmqpProperties properties = sut.BuildPropertiesFromProperties(basicProperties); properties.Should().NotBeNull(because: "Builder can build empty properties"); }
public void CanCreateEmptyAmqpProperties() { IMessage message = A.Fake <IMessage>(); var sut = new AmqpPropertyBuilder(); IAmqpProperties properties = sut.BuildPropertiesFromHeaders(message.Headers); properties.Should().NotBeNull(because: "Builder can build empty properties"); }
public void CanCreateAmqpPropertiesWithReplyToFromBasicProperties() { IBasicProperties basicProperties = A.Fake <IBasicProperties>(); const string headerValue = "some address"; A.CallTo(() => basicProperties.ReplyTo).Returns(headerValue); var sut = new AmqpPropertyBuilder(); IAmqpProperties properties = sut.BuildPropertiesFromProperties(basicProperties); properties.ReplyTo.Should().Be(headerValue); properties.Should().NotBeNull(because: "builder can build replyto from BasicProperties"); }
public void CanCreateAmqpPropertiesWithPersistentFromBasicProperties() { IBasicProperties basicProperties = A.Fake <IBasicProperties>(); const string headerValue = "true"; A.CallTo(() => basicProperties.Persistent).Returns(bool.Parse(headerValue)); var sut = new AmqpPropertyBuilder(); IAmqpProperties properties = sut.BuildPropertiesFromProperties(basicProperties); properties.Persistent.Should().Be(bool.Parse(headerValue)); properties.Should().NotBeNull(because: "builder can build persistent from BasicProperties"); }
public void CanCreateAmqpPropertiesWithMessageIdFromBasicProperties() { IBasicProperties basicProperties = A.Fake <IBasicProperties>(); const string headerValue = "100500"; A.CallTo(() => basicProperties.MessageId).Returns(headerValue); var sut = new AmqpPropertyBuilder(); IAmqpProperties properties = sut.BuildPropertiesFromProperties(basicProperties); properties.MessageId.Should().Be(headerValue); properties.Should().NotBeNull(because: "builder can build message id from BasicProperties"); }
public void CanCreateAmqpPropertiesWithContentTypeFromBasicProperites() { IBasicProperties basicProperties = A.Fake <IBasicProperties>(); const string headerValue = "text/plain"; A.CallTo(() => basicProperties.ContentType).Returns(headerValue); var sut = new AmqpPropertyBuilder(); IAmqpProperties properties = sut.BuildPropertiesFromProperties(basicProperties); properties.ContentType.Should().Be(headerValue); properties.Should().NotBeNull(because: "builder can build content type from BasicProperties"); }
public void CanCreateAmqpPropertiesWithMessageId() { IMessage message = A.Fake <IMessage>(); const string headerValue = "100500"; A.CallTo(() => message.Headers) .Returns(new Dictionary <string, string> { { AmqpPropertyBuilder.MessageId, headerValue } }); var sut = new AmqpPropertyBuilder(); IAmqpProperties properties = sut.BuildPropertiesFromHeaders(message.Headers); properties.MessageId.Should().Be(headerValue); properties.Should().NotBeNull(because: "builder can build message id from message headers"); }
public void CanCreateAmqpPropertiesWithContentType() { IMessage message = A.Fake <IMessage>(); const string headerValue = "text/plain"; A.CallTo(() => message.Headers) .Returns(new Dictionary <string, string> { { AmqpPropertyBuilder.ContentType, headerValue } }); var sut = new AmqpPropertyBuilder(); IAmqpProperties properties = sut.BuildPropertiesFromHeaders(message.Headers); properties.ContentType.Should().Be(headerValue); properties.Should().NotBeNull(because: "builder can build content type from message headers"); }
public void CanCreateAmqpPropertiesWithPersistent() { IMessage message = A.Fake <IMessage>(); const string headerValue = "true"; A.CallTo(() => message.Headers) .Returns(new Dictionary <string, string> { { AmqpPropertyBuilder.Persistent, headerValue } }); var sut = new AmqpPropertyBuilder(); IAmqpProperties properties = sut.BuildPropertiesFromHeaders(message.Headers); properties.Persistent.Should().Be(bool.Parse(headerValue)); properties.Should().NotBeNull(because: "builder can build persistent from message headers"); }