public void AddBeforeShouldThrowNotFoundPipelineStepExceptionWhenGivenKeyIsNotFound()
        {
            _sut.Add(Step1);
            _sut.Add(Step2);

            Action act = () => { _sut.AddBefore("StepX", Step3); };

            act.Should().Throw <NotFoundPipelineStepException>().And.Key.Should().Be("StepX");
        }
예제 #2
0
 private void AddOrReplace(Pipeline pipeline, string before, string name, IChannelHandler handler)
 {
     if (pipeline.Names.Contains(name))
     {
         pipeline.Replace(name, name, handler);
     }
     else
     {
         if (before == null)
         {
             pipeline.AddFirst(name, handler);
         }
         else
         {
             pipeline.AddBefore(before, name, handler);
         }
     }
 }