public void BuildBasicPropertiesByConfiguration()
{
const String contentType = "application/json";
const String contentEncoding = "UTF-8";
const String messageId = "one-id";
const Int64 timestamp = 123456789L;
var collection = new HeaderCollection(new Dictionary<String, Object>(StringComparer.OrdinalIgnoreCase)
{
{ "content_type", contentType },
{ "content_encoding", contentEncoding }
});
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 newId = new Mock<INewId>();
newId.Setup(_ => _.Next()).Returns(messageId);
var dateTimeProvider = new Mock<IDateTimeProvider>();
dateTimeProvider.Setup(_ => _.UtcNow()).Returns(timestamp.ToDateTimeOffset());
var message = new OutboundMessage<Foo>(new Foo(), collection);
var properties = message.BuildBasicProperties(resolver.Object, dateTimeProvider.Object, newId.Object);
Assert.Equal(messageId, properties.MessageId);
Assert.Equal(new AmqpTimestamp(timestamp), properties.Timestamp);
Assert.Equal(contentType, properties.ContentType);
Assert.Equal(contentEncoding, properties.ContentEncoding);
}