protected AmqpNmsMessageFacade CreateReceivedMessageFacade(IAmqpConsumer consumer, global::Amqp.Message message)
        {
            AmqpNmsMessageFacade facade = new AmqpNmsMessageFacade();

            facade.Initialize(consumer, message);
            return(facade);
        }
        protected AmqpNmsMessageFacade CreateNewMessageFacade()
        {
            AmqpNmsMessageFacade facade = new AmqpNmsMessageFacade();

            facade.Initialize(CreateMockAmqpConnection());
            return(facade);
        }
        protected AmqpNmsMessageFacade CreateReceivedMessageFacade(global::Amqp.Message message)
        {
            AmqpNmsMessageFacade facade             = new AmqpNmsMessageFacade();
            IAmqpConnection      mockAmqpConnection = CreateMockAmqpConnection();
            var mockConsumer = CreateMockConsumer(mockAmqpConnection);

            facade.Initialize(mockConsumer, message);
            return(facade);
        }
Exemple #4
0
        public void TestNMSDeliveryTime_Set_ShouldHaveMessageAnnotations()
        {
            AmqpNmsMessageFacade msg = new AmqpNmsMessageFacade();

            Mock <IAmqpConnection> mockAmqpConnection = new Mock <IAmqpConnection>();

            msg.Initialize(mockAmqpConnection.Object);
            var deliveryTime = DateTime.UtcNow.AddMinutes(2);

            msg.DeliveryTime = deliveryTime;

            Assert.AreEqual(new DateTimeOffset(deliveryTime).ToUnixTimeMilliseconds(), msg.MessageAnnotations[SymbolUtil.NMS_DELIVERY_TIME]);
        }