public void ContentTypeFromAmqpMessage() { var message = AmqpMessage.Create(new MemoryStream(new byte[12]), true); AddSection(message, SectionFlag.Properties); message.Properties.ContentType = "this content type"; var eventData = AmqpMessageConverter.AmqpMessageToEventData(message); Assert.Equal(message.Properties.ContentType.Value, eventData.ContentType); }
void UpdateEventDataHeaderAndPropertiesReceiveCorrelationIdAndCopyItsValueToEventData() { // Arrange // the following simulates a message's round trip from client to broker to client var message = AmqpMessage.Create(new MemoryStream(new byte[12]), true); AddSection(message, SectionFlag.Properties); // serialize - send the message on client side ArraySegment <byte>[] buffers = ReadMessagePayLoad(message, 71); // Act var eventData = AmqpMessageConverter.AmqpMessageToEventData(message); // Assert Assert.NotNull(eventData); Assert.NotNull(eventData.SystemProperties); Assert.NotNull(eventData.SystemProperties[Properties.CorrelationIdName]); Assert.Equal("42", eventData.SystemProperties[Properties.CorrelationIdName].ToString()); }