public void ShouldRetrieveEventProcessorForHandler()
        {
            _repository.Add(_processor1, _handler1, _barrier1);
            var processor = _repository.GetEventProcessorFor(_handler1);

            Assert.Equal(processor, _processor1);
        }
 /// <summary>
 ///  Specify the {@link ExceptionHandler} to use with the event handler.
 /// </summary>
 /// <param name="exceptionHandler">the exception handler to use.</param>
 public void With(IExceptionHandler exceptionHandler)
 {
     ((BatchEventProcessor <T>)consumerRepository
      .GetEventProcessorFor(eventHandler))
     .SetExceptionHandler(exceptionHandler);
     consumerRepository
     .GetBarrierFor(eventHandler)
     .Alert();
 }
    /// <summary>
    /// Specify the <see cref="IExceptionHandler{T}"/> to use with the event handler.
    /// </summary>
    /// <param name="exceptionHandler">exceptionHandler the exception handler to use.</param>
    public void With(IExceptionHandler <T> exceptionHandler)
    {
        var eventProcessor = _consumerRepository.GetEventProcessorFor(_eventHandler);

        if (eventProcessor is IAsyncEventProcessor <T> asyncEventProcessor)
        {
            asyncEventProcessor.SetExceptionHandler(exceptionHandler);
        }
        else
        {
            ((IEventProcessor <T>)eventProcessor).SetExceptionHandler(exceptionHandler);
        }
    }
 public void ShouldRetrieveEventProcessorForHandler()
 {
     _consumerRepository.Add(_eventProcessor1, _handler1, _barrier1);
     Assert.That(_consumerRepository.GetEventProcessorFor(_handler1), Is.SameAs(_eventProcessor1));
 }
 /// <summary>
 /// Specify the <see cref="IValueExceptionHandler{T}"/> to use with the event handler.
 /// </summary>
 /// <param name="exceptionHandler">exceptionHandler the exception handler to use.</param>
 public void With(IValueExceptionHandler <T> exceptionHandler)
 {
     ((IValueEventProcessor <T>)_consumerRepository.GetEventProcessorFor(_eventHandler)).SetExceptionHandler(exceptionHandler);
 }
Exemplo n.º 6
0
 public void ShouldRetrieveEventProcessorForHandler()
 {
     _consumerRepository.Add(_eventProcessor1.Object, _handler1, _barrier1.Object);
     Assert.That(_consumerRepository.GetEventProcessorFor(_handler1), Is.EqualTo(_eventProcessor1.Object));
 }