Ejemplo n.º 1
0
 public void Can_Publish_to_AnyTestMq_Service()
 {
     using (var mqFactory = appHost.TryResolve <IMessageFactory>())
     {
         var request = new AnyTestMq {
             Id = 1
         };
         mqFactory.CreateMessageProducer().Publish(request);
         var msg = mqFactory.CreateMessageQueueClient().Get(QueueNames <AnyTestMqResponse> .In, null)
                   .ToMessage <AnyTestMqResponse>();
         Assert.That(msg.GetBody().CorrelationId, Is.EqualTo(request.Id));
     }
 }
Ejemplo n.º 2
0
        public void SendOneWay_calls_AnyTestMq_Service_via_MQ()
        {
            var client  = new JsonServiceClient(BaseUri);
            var request = new AnyTestMq {
                Id = 3
            };

            client.SendOneWay(request);

            using (var mqFactory = appHost.TryResolve <IMessageFactory>())
            {
                var msg = mqFactory.CreateMessageQueueClient().Get(QueueNames <AnyTestMqResponse> .In, null)
                          .ToMessage <AnyTestMqResponse>();
                Assert.That(msg.GetBody().CorrelationId, Is.EqualTo(request.Id));
            }
        }
Ejemplo n.º 3
0
 /// <summary>Anies the given request.</summary>
 ///
 /// <param name="request">The request.</param>
 ///
 /// <returns>An object.</returns>
 public object Any(AnyTestMq request)
 {
     return new AnyTestMqResponse { CorrelationId = request.Id };
 }
Ejemplo n.º 4
0
        public void SendOneWay_calls_AnyTestMq_Service_via_MQ()
        {
            var client = new JsonServiceClient(BaseUri);
            var request = new AnyTestMq { Id = 3 };

            client.SendOneWay(request);

            using (var mqFactory = appHost.TryResolve<IMessageFactory>())
            {
                var msg = mqFactory.CreateMessageQueueClient().Get(QueueNames<AnyTestMqResponse>.In, null)
                    .ToMessage<AnyTestMqResponse>();
                Assert.That(msg.GetBody().CorrelationId, Is.EqualTo(request.Id));
            }
        }
Ejemplo n.º 5
0
 public void Can_Publish_to_AnyTestMq_Service()
 {
     using (var mqFactory = appHost.TryResolve<IMessageFactory>())
     {
         var request = new AnyTestMq { Id = 1 };
         mqFactory.CreateMessageProducer().Publish(request);
         var msg = mqFactory.CreateMessageQueueClient().Get(QueueNames<AnyTestMqResponse>.In, null)
             .ToMessage<AnyTestMqResponse>();
         Assert.That(msg.GetBody().CorrelationId, Is.EqualTo(request.Id));
     }
 }
Ejemplo n.º 6
0
 /// <summary>Anies the given request.</summary>
 ///
 /// <param name="request">The request.</param>
 ///
 /// <returns>An object.</returns>
 public object Any(AnyTestMq request)
 {
     return(new AnyTestMqResponse {
         CorrelationId = request.Id
     });
 }