public void Should_invoke_timeout_method()
        {
            var cache = new MessageHandlerRegistry(new Conventions());

            cache.CacheMethodForHandler(typeof(StubHandler), typeof(StubTimeoutState));
            var handler = new StubHandler();

            cache.InvokeTimeout(handler, new StubTimeoutState());
            Assert.IsTrue(handler.TimeoutCalled);
        }
        public void Should_have_passed_through_correct_state()
        {
            var cache = new MessageHandlerRegistry(new Conventions());

            cache.CacheMethodForHandler(typeof(StubHandler), typeof(StubTimeoutState));
            var handler   = new StubHandler();
            var stubState = new StubTimeoutState();

            cache.InvokeTimeout(handler, stubState);
            Assert.AreEqual(stubState, handler.HandledState);
        }