public void AfterCompletionWithPreSendException()
        {
            var interceptor1 = new AfterCompletionTestInterceptor();
            var interceptor2 = new AfterCompletionTestInterceptor();

            interceptor2.ExceptionToRaise = new Exception("Simulated exception");
            channel.AddInterceptor(interceptor1);
            channel.AddInterceptor(interceptor2);
            try
            {
                channel.Send(Support.MessageBuilder.WithPayload("test").Build());
            }
            catch (Exception ex)
            {
                Assert.Equal("Simulated exception", ex.InnerException.Message);
            }

            Assert.True(interceptor1.AfterCompletionInvoked);
            Assert.False(interceptor2.AfterCompletionInvoked);
        }
        public void AfterCompletionWithSendException()
        {
            AbstractMessageChannel testChannel = new AfterCompletionWithSendExceptionChannel(provider);

            var interceptor1 = new AfterCompletionTestInterceptor();
            var interceptor2 = new AfterCompletionTestInterceptor();

            testChannel.AddInterceptor(interceptor1);
            testChannel.AddInterceptor(interceptor2);
            try
            {
                testChannel.Send(Support.MessageBuilder.WithPayload("test").Build());
            }
            catch (Exception ex)
            {
                Assert.Equal("Simulated exception", ex.InnerException.Message);
            }

            Assert.True(interceptor1.AfterCompletionInvoked);
            Assert.True(interceptor2.AfterCompletionInvoked);
        }