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>())
                using (var mqClient = mqFactory.CreateMessageQueueClient())
                {
                    var msg = mqClient.Get <PostTestMqResponse>(QueueNames <PostTestMqResponse> .In, null);
                    mqClient.Ack(msg);
                    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, null);
                    mqClient.Ack(msg);
                    Assert.That(msg.GetBody().CorrelationId, Is.EqualTo(request.Id));
                }
            }
        }
 public object Post(PostTestMq request)
 {
     return(new PostTestMqResponse {
         CorrelationId = request.Id
     });
 }