public void AsyncResultEventHadlerTest()
        {
            var  dispatcher = new EventDispatcher(_logFactory, "testBC");
            var  handler    = new AsyncResultEventHandler(false);
            bool ack        = false;

            dispatcher.Wire("testBC", handler);
            dispatcher.Dispatch("testBC", "test", (delay, acknowledge) => { ack = acknowledge; });

            Assert.AreEqual(1, handler.HandledEvents.Count);
            Assert.True(ack, "Event handler was not processed properly");
        }
        public void ExceptionForAsyncResultEventHadlerTest()
        {
            var dispatcher  = new EventDispatcher(_logFactory, "testBC");
            var handler     = new AsyncResultEventHandler(true);
            int failedCount = 0;

            dispatcher.Wire("testBC", handler);
            dispatcher.Dispatch("testBC", "test", (delay, acknowledge) =>
            {
                if (!acknowledge)
                {
                    ++failedCount;
                }
            });

            Assert.AreEqual(0, handler.HandledEvents.Count);
            Assert.AreEqual(1, failedCount, "Event handler was not processed properly");
        }