Esempio n. 1
0
        public void RethrowExceptions_will_cause_exceptions_to_be_rethrown()
        {
            var dispatcher = new TestActionDispatcher(FExceptionThrowingMethod);

            dispatcher.RethrowExceptions();

            Expect(() => dispatcher.Invoke()).ToThrow.Message.EqualTo("this throws");
        }
Esempio n. 2
0
        public void After_will_be_called_after()
        {
            bool afterCalled = false;
            var  dispatcher  = new TestActionDispatcher(() => {});

            dispatcher.After(() => { afterCalled = true; });

            dispatcher.Invoke();
            Assert.True(afterCalled);
        }
Esempio n. 3
0
        public void Before_will_be_called_first()
        {
            bool beforeCalled = false;
            var  dispatcher   = new TestActionDispatcher(() => {});

            dispatcher.Before(() => { beforeCalled = true; });

            dispatcher.Invoke();
            Assert.True(beforeCalled);
        }
Esempio n. 4
0
        public void Invoke_will_swallow_exceptions_by_default()
        {
            var dispatcher = new TestActionDispatcher(FExceptionThrowingMethod);

            Assert.DoesNotThrow(() => dispatcher.Invoke());
        }