public void Clone_ReturnsCloneOfTheMessage_WhenMessageProvided() { DateTime testExpiryTime = DateTime.UtcNow.Date; var message = new Amqp.Message("Abc") { Header = new Amqp.Framing.Header { Durable = true }, Properties = new Amqp.Framing.Properties { CorrelationId = "myCorrelationId", AbsoluteExpiryTime = testExpiryTime } }; Amqp.Message clone = message.Clone(); clone.ShouldSatisfyAllConditions( () => clone.ShouldNotBeSameAs(message), () => clone.Header.ShouldNotBeSameAs(message.Header), () => clone.Header.Durable.ShouldBeTrue(), () => clone.Properties.ShouldNotBeSameAs(message.Properties), () => clone.Properties.CorrelationId.ShouldBe("myCorrelationId"), () => clone.Properties.AbsoluteExpiryTime.ShouldBe(testExpiryTime) ); }
public void AddSequenceNumber_AddsSequenceNumber(long sequenceNo) { var message = new Amqp.Message(); message.AddSequenceNumber(sequenceNo); message.ShouldSatisfyAllConditions( () => message.MessageAnnotations.ShouldNotBeNull(), () => message.MessageAnnotations[(Symbol)"x-opt-sequence-number"].ShouldBe(sequenceNo) ); }