public void BuildBasicProperties()
{
const String contentType = "application/xml";
const String contentEncoding = "UTF-16";
const String messageId = "one-id";
const Int64 timestamp = 123456789L;
const String replyExchangeName = "reply-queue-name";
const String replyRoutingKey = "reply-queue-name";
var correlationId = new Guid(1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1).ToString();
var directReplyConfiguration = new DirectReplyConfiguration(replyExchangeName,
replyRoutingKey);
var collection = new HeaderCollection(new Dictionary<String, Object>(StringComparer.OrdinalIgnoreCase)
{
{ "message_id", messageId },
{ "timestamp", timestamp },
{ "content_type", contentType },
{ "content_encoding", contentEncoding },
{ "correlation_id", correlationId },
{ "reply_configuration", directReplyConfiguration }
});
const String key = "foo";
const String value = "bar";
collection.AddHeader(key, value);
var resolver = new Mock<IMessageTypeResolver>();
resolver.Setup(_ => _.Resolve<Foo>()).Returns(EmptyMessageBinding.Instance);
var message = new OutboundMessage<Foo>(new Foo(), collection);
var properties = message.BuildBasicProperties(resolver.Object, null, null);
Assert.Equal(messageId, properties.MessageId);
Assert.Equal(new AmqpTimestamp(timestamp), properties.Timestamp);
Assert.Equal(contentType, properties.ContentType);
Assert.Equal(contentEncoding, properties.ContentEncoding);
Assert.Equal(correlationId, properties.CorrelationId);
Assert.Equal(directReplyConfiguration.ToString(), properties.ReplyTo);
Assert.Equal(value, collection[key]);
}