public void Can_Publish_to_PostTestMq_Service()
 {
     using (var mqFactory = appHost.TryResolve <IMessageFactory>())
     {
         var request = new PostTestMq {
             Id = 2
         };
         mqFactory.CreateMessageProducer().Publish(request);
         var msg = mqFactory.CreateMessageQueueClient().Get(QueueNames <PostTestMqResponse> .In, null)
                   .ToMessage <PostTestMqResponse>();
         Assert.That(msg.GetBody().CorrelationId, Is.EqualTo(request.Id));
     }
 }
        public void SendOneWay_calls_PostTestMq_Service_via_MQ()
        {
            var client  = new JsonServiceClient(BaseUri);
            var request = new PostTestMq {
                Id = 4
            };

            client.SendOneWay(request);

            using (var mqFactory = appHost.TryResolve <IMessageFactory>())
            {
                var msg = mqFactory.CreateMessageQueueClient().Get(QueueNames <PostTestMqResponse> .In, null)
                          .ToMessage <PostTestMqResponse>();
                Assert.That(msg.GetBody().CorrelationId, Is.EqualTo(request.Id));
            }
        }
        public void Can_Publish_to_PostTestMq_Service()
        {
            using (var mqFactory = AppHost.TryResolve <IMessageFactory>())
            {
                var request = new PostTestMq {
                    Id = 2
                };

                using (var mqProducer = mqFactory.CreateMessageProducer())
                    mqProducer.Publish(request);

                using (var mqClient = mqFactory.CreateMessageQueueClient())
                {
                    var msg = mqClient.Get <PostTestMqResponse>(QueueNames <PostTestMqResponse> .In, MessageTimeout);
                    mqClient.Ack(msg);
                    Assert.That(msg.GetBody().CorrelationId, Is.EqualTo(request.Id));
                }
            }
        }
 public object Post(PostTestMq request)
 {
     return(new PostTestMqResponse {
         CorrelationId = request.Id
     });
 }
 public object Post(PostTestMq request)
 {
     return new PostTestMqResponse { CorrelationId = request.Id };
 }
        public void SendOneWay_calls_PostTestMq_Service_via_MQ()
        {
            var client = new JsonServiceClient(BaseUri);
            var request = new PostTestMq { Id = 4 };

            client.SendOneWay(request);

            using (var mqFactory = appHost.TryResolve<IMessageFactory>())
            {
                var msg = mqFactory.CreateMessageQueueClient().Get(QueueNames<PostTestMqResponse>.In, null)
                    .ToMessage<PostTestMqResponse>();
                Assert.That(msg.GetBody().CorrelationId, Is.EqualTo(request.Id));
            }
        }
 public void Can_Publish_to_PostTestMq_Service()
 {
     using (var mqFactory = appHost.TryResolve<IMessageFactory>())
     {
         var request = new PostTestMq { Id = 2 };
         mqFactory.CreateMessageProducer().Publish(request);
         var msg = mqFactory.CreateMessageQueueClient().Get(QueueNames<PostTestMqResponse>.In, null)
             .ToMessage<PostTestMqResponse>();
         Assert.That(msg.GetBody().CorrelationId, Is.EqualTo(request.Id));
     }
 }