Exemplo n.º 1
0
        public async Task HandleErrorAsync_notifies_engine_on_Event([Frozen] IBusEngine engine, DiscardErrorFilter sut, IEventContext <FirstTestEvent> context, Exception exception, EventErrorDelegate <FirstTestEvent> next)
        {
            await sut.HandleErrorAsync(context, exception, next);

            Mock.Get(engine).Verify(p => p.NotifyFailAsync(context.Message));
        }
Exemplo n.º 2
0
        public async Task HandleErrorAsync_forwards_to_next_if_error_on_Event([Frozen] IBusEngine engine, DiscardErrorFilter sut, IEventContext <FirstTestEvent> context, Exception exception, Exception discardException, EventErrorDelegate <FirstTestEvent> next)
        {
            Mock.Get(engine).Setup(p => p.NotifyFailAsync(It.IsAny <Message>())).ThrowsAsync(discardException);

            await sut.HandleErrorAsync(context, exception, next);

            Mock.Get(next).Verify(p => p(context, exception));
        }
Exemplo n.º 3
0
 public NybusHostConfigurationFactory(IEnumerable <IErrorFilterProvider> errorFilterProviders, DiscardErrorFilter fallbackErrorFilter)
 {
     _fallbackErrorFilter        = fallbackErrorFilter ?? throw new ArgumentNullException(nameof(fallbackErrorFilter));
     _errorFilterProvidersByName = CreateDictionary(errorFilterProviders ?? throw new ArgumentNullException(nameof(errorFilterProviders)));
 }