public void GivenAMessageThatWillFailHandling_WhenAskedToPublish_ShouldAllowRetryableExceptionsToPropagate()
        {
            Conventions.SetRetryableEventHandlingExceptionFilter((o, e) => true);
            var failingEventHandler = new FailingEventHandler();

            Resolver.Reset();
            Resolver.Configure(
                type => null,
                type => new object[] { failingEventHandler }.Where(x => type.IsAssignableFrom(x.GetType())),
                o => { });

            var eventThatWillFailToBeHandled = new SimpleEvent();
            var exception = Assert.Throws <TargetInvocationException>(() => _eventBus.Publish(eventThatWillFailToBeHandled));

            CollectionAssert.AreEqual(
                new[]
            {
                typeof(SimpleEvent)
            },
                failingEventHandler.TargetsCalled);
        }
        public void GivenAMessageThatWillFailHandling_WhenAskedToPublish_ShouldGenerateFailedHandlingMessage()
        {
            var failingEventHandler = new FailingEventHandler();

            Resolver.Reset();
            Resolver.Configure(
                type => null,
                type => new object[] { failingEventHandler }.Where(x => type.IsAssignableFrom(x.GetType())),
                o => { });

            var eventThatWillFailToBeHandled = new SimpleEvent();

            _eventBus.Publish(eventThatWillFailToBeHandled);

            CollectionAssert.AreEqual(
                new[]
            {
                typeof(SimpleEvent),
                typeof(IEventHandlingFailedEvent <SimpleEvent>)
            },
                failingEventHandler.TargetsCalled);
        }