public void TestDefaultListenerMethod()
        {
            var called = new AtomicBoolean(false);
            var handlerDelegate = new HandlerDelegate(called);

            this.adapter.HandlerObject = handlerDelegate;
            this.adapter.OnMessage(new Message(Encoding.UTF8.GetBytes("foo"), this.messageProperties));
            Assert.True(handlerDelegate.Called);
        }
        public void TestFuncListenerMethod()
        {
            var called = new AtomicBoolean(false);
            var handlerDelegate = new Func<string, string>(
                input =>
                {
                    called.LazySet(true);
                    return "processed" + input;
                });

            this.adapter.HandlerObject = handlerDelegate;
            this.adapter.OnMessage(new Message(Encoding.UTF8.GetBytes("foo"), this.messageProperties));
            Assert.True(called.Value);
        }
 /// <summary>Initializes a new instance of the <see cref="HandlerDelegate"/> class.</summary>
 /// <param name="called">The called.</param>
 public HandlerDelegate(AtomicBoolean called) { this.Called = called; }