Пример #1
0
        public void AnExceptionThrownByASinkIsNotPropagated()
        {
            var thrown = false;

            var s = new SafeAggregateSink(new[] { new DelegatingSink(le => {
                thrown = true;
                throw new Exception("No go, pal.");
            }) });

            s.Emit(Some.InformationEvent());

            Assert.True(thrown);
        }
Пример #2
0
        public void WhenASinkThrowsOtherSinksAreStillInvoked()
        {
            bool called1 = false, called2 = false;

            var s = new SafeAggregateSink(new[] {
                new DelegatingSink(le => called1 = true),
                new DelegatingSink(le => { throw new Exception("No go, pal."); }),
                new DelegatingSink(le => called2 = true)
            });

            s.Emit(Some.InformationEvent());

            Assert.True(called1 && called2);
        }