Exemplo n.º 1
0
        public void Can_handle_custom_exception()
        {
            MqAppHostServices.TimesCalled = 0;

            using (var mqClient = appHost.TryResolve <IMessageService>().CreateMessageQueueClient())
            {
                mqClient.Publish(new MqCustomException {
                    Message = "foo"
                });

                Thread.Sleep(1000);

                Assert.That(MqAppHostServices.TimesCalled, Is.EqualTo(2));
                Assert.That(appHost.LastCustomException.Message, Is.EqualTo("ERROR: foo"));
            }
        }