コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }