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));
            }
        }
 /// <summary>Post this message.</summary>
 ///
 /// <param name="request">The request.</param>
 ///
 /// <returns>An object.</returns>
 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));
     }
 }
 /// <summary>Post this message.</summary>
 ///
 /// <param name="request">The request.</param>
 ///
 /// <returns>An object.</returns>
 public object Post(PostTestMq request)
 {
     return(new PostTestMqResponse {
         CorrelationId = request.Id
     });
 }