public void Does_send_to_DLQ_when_thrown_from_void_Service() { using (var mqFactory = appHost.TryResolve <IMessageFactory>()) { var request = new ThrowVoid { Content = "Test" }; using (var mqProducer = mqFactory.CreateMessageProducer()) using (var mqClient = mqFactory.CreateMessageQueueClient()) { mqProducer.Publish(request); var msg = mqClient.Get <ThrowVoid>(QueueNames <ThrowVoid> .Dlq, null); mqClient.Ack(msg); Assert.That(msg.Error.ErrorCode, Is.EqualTo("InvalidOperationException")); } } }
public void Any(ThrowVoid request) { throw new InvalidOperationException("this is an invalid operation"); }