public void Should_be_able_to_connect_pipelines()
        {
            var pipelineA = CorePipeline.Create(c => c
                                                .Name("Pipeline A")
                                                .AutoRaiseEvents(false)
                                                .Stages()
                                                .RegisterStage("Stage 1")
                                                .ForEvent <OnParseEvent>());

            var observer = new ReverseParserObserver();

            var pipelineB = CorePipeline.Create(c => c
                                                .Name("Pipeline B")
                                                .Observers()
                                                .RegisterObserver(observer));

            pipelineA.Connect(pipelineB)
            .ForStages("Stage 1")
            .ForEvent <OnParseEvent>();

            pipelineA.RunAsync();
            pipelineA.RaiseEvent <OnParseEvent>("Stage 1");

            while (pipelineA.State == PipelineState.Running)
            {
                Thread.Sleep(1000);

                Assert.True(observer.IsSyncParseCompleted, "The second sync event was not observed after async event.");
                pipelineA.Abort();
            }
        }
        public void Should_be_able_to_connect_pipelines_for_one_stage()
        {
            var pipelineA = CorePipeline.Create(c => c
                                                .Name("Pipeline A")
                                                .AutoRaiseEvents(true)
                                                .Stages()
                                                .RegisterStage("Stage 1")
                                                .ForEvent <OnParseEvent>()
                                                .RegisterStage("Stage 2")
                                                .ForEvent <OnSomeEvent>());

            var observer = new ReverseParserObserver();

            var pipelineB = CorePipeline.Create(c => c
                                                .Name("Pipeline B")
                                                .Observers()
                                                .RegisterObserver(observer));

            pipelineA.Connect(pipelineB)
            .ForStages("Stage 2")
            .ForEvent <OnSomeEvent>();

            pipelineA.Run();
        }