public void ShouldNotFirePipelineRunEventIfNotSubscribed()
    {
      // arrange
      var processor = new PipelineWatcherProcessor("mypipeline");

      // act
      processor.Process(new PipelineArgs());
    }
    public void ShouldRaisePipelineRunEventIfSubscribed()
    {
      // arrange
      var processor = new PipelineWatcherProcessor("mypipeline");
      processor.MonitorEvents();

      // act
      processor.Process(this.pipelineArgs);

      // assert
      processor.ShouldRaise("PipelineRun")
        .WithSender(processor)
        .WithArgs<PipelineRunEventArgs>(a => a.PipelineName == "mypipeline" && a.PipelineArgs == this.pipelineArgs);
    }
    public void ShouldExecuteRegisteredProcessor()
    {
      // arrange
      var processor = Substitute.For<IPipelineProcessor>();
      var args = new PipelineArgs();

      this.watcher.Register("mypipeline", processor);

      var watcherProcessor = new PipelineWatcherProcessor("mypipeline");

      // act
      watcherProcessor.Process(args);

      // assert
      processor.Received().Process(args);
    }
    public void ShouldSubscribeAndUnsubscribeFromPipelineRunEvent()
    {
      // arrange
      var w = new ThrowablePipelineWatcher();
      var processor = new PipelineWatcherProcessor("pipeline");

      // act
      w.Dispose();

      // assert
      processor.Process(new PipelineArgs());
    }