Exemplo n.º 1
0
        public void SetNext(IPipeLineHandler <TContext> nextHandler)
        {
            if (nextHandler == null)
            {
                throw new ArgumentNullException(nameof(nextHandler), "Next handler cannot be null");
            }

            if (nextHandler == this)
            {
                throw new ArgumentException("Next handler cannot be same handler", nameof(nextHandler));
            }

            Next = nextHandler.ExecuteAsync;
        }
Exemplo n.º 2
0
        public IPipeLineBuilder <TContext> UseHandler(IPipeLineHandler <TContext> handler)
        {
            if (handler == null)
            {
                throw new ArgumentNullException(nameof(handler), "Handler cannot be null");
            }

            if (_handlers.Contains(handler))
            {
                throw new ArgumentException("This handler already using", nameof(handler));
            }

            _handlers.Add(handler);

            return(this);
        }
Exemplo n.º 3
0
 public void SetUp()
 {
     _handler = new FileSendHandler(_settings, _mailSender, _messageBuilder, _logger);
 }
Exemplo n.º 4
0
 public void SetUp()
 {
     _pipeLineHandler = Substitute.For <PipeLineHandler <object> >();
 }
 public void SetUp()
 {
     _handler = Substitute.For <CriticalAndCancelExceptionHandler>(_logger);
 }
Exemplo n.º 6
0
 public void SetUp()
 {
     _pipeLineHandler = Substitute.For <PipeLineHandler <object> >();
     _builder         = new PipeLineBuilder <object>();
 }
Exemplo n.º 7
0
 public void SetUp()
 {
     _handler = new FileDeleteHandler(_logger);
 }