public void TestPreSendInterceptorReturnsNull()
        {
            QueueChannel channel = new QueueChannel();
            PreSendReturnsNullInterceptor interceptor = new PreSendReturnsNullInterceptor();

            channel.AddInterceptor(interceptor);
            IMessage message = new StringMessage("test");

            channel.Send(message);
            Assert.That(interceptor.Count, Is.EqualTo(1));
            IMessage result = channel.Receive(TimeSpan.Zero);

            Assert.IsNull(result);
        }
예제 #2
0
        public void TestPreSendInterceptorReturnsNull()
        {
            var interceptor = new PreSendReturnsNullInterceptor();

            channel.AddInterceptor(interceptor);
            IMessage message = new GenericMessage("test");

            channel.Send(message);
            Assert.Equal(1, interceptor.Counter);

            Assert.True(channel.RemoveInterceptor(interceptor));

            channel.Send(new GenericMessage("TEST"));
            Assert.Equal(1, interceptor.Counter);

            var result = channel.Receive(0);

            Assert.NotNull(result);
            Assert.Equal("TEST", result.Payload);
        }
 public void TestPreSendInterceptorReturnsNull()
 {
     QueueChannel channel = new QueueChannel();
     PreSendReturnsNullInterceptor interceptor = new PreSendReturnsNullInterceptor();
     channel.AddInterceptor(interceptor);
     IMessage message = new StringMessage("test");
     channel.Send(message);
     Assert.That(interceptor.Count, Is.EqualTo(1));
     IMessage result = channel.Receive(TimeSpan.Zero);
     Assert.IsNull(result);
 }