Ejemplo n.º 1
0
        internal PipelineEvent Reset(Pipeline pipeline)
        {
            Guard.AgainstNull(pipeline, "pipeline");

            Pipeline = pipeline;

            return this;
        }
        public static void AccessException(this IIdempotenceService service, ILog log, Exception ex, Pipeline pipeline)
        {
            Guard.AgainstNull(service, "service");
            Guard.AgainstNull(log, "log");
            Guard.AgainstNull(ex, "ex");
            Guard.AgainstNull(pipeline, "pipeline");

            log.Fatal(string.Format(ESBResources.FatalIdempotenceServiceException, service.GetType().FullName,
                                    ex.AllMessages()));

            pipeline.Abort();
        }
Ejemplo n.º 3
0
        public void Should_be_able_to_register_events_after_existing_event()
        {
            var pipeline = new Pipeline();

            pipeline.RegisterStage("Stage")
                    .WithEvent<MockPipelineEvent3>()
                    .AfterEvent<MockPipelineEvent3>().Register<MockPipelineEvent2>()
                    .AfterEvent<MockPipelineEvent2>().Register(new MockPipelineEvent1());

            var observer = new MockAuthenticateObserver();

            pipeline.RegisterObserver(observer);

            pipeline.Execute();

            Assert.AreEqual("321", observer.CallSequence);
        }
Ejemplo n.º 4
0
        public void Should_be_able_to_execute_a_valid_pipeline()
        {
            var pipeline = new Pipeline();

            pipeline
                .RegisterStage("Stage")
                .WithEvent<MockPipelineEvent1>()
                .WithEvent<MockPipelineEvent2>()
                .WithEvent<MockPipelineEvent3>();

            var observer = new MockAuthenticateObserver();

            pipeline.RegisterObserver(observer);

            pipeline.Execute();

            Assert.AreEqual("123", observer.CallSequence);
        }
Ejemplo n.º 5
0
 public PipelineEventArgs(Pipeline pipeline)
 {
     Pipeline = pipeline;
 }
 public PipelineExceptionEventArgs(Pipeline pipeline)
 {
     Pipeline = pipeline;
 }
Ejemplo n.º 7
0
        public void Should_not_be_able_to_register_a_null_event()
        {
            var pipeline = new Pipeline();

            Assert.Throws<NullReferenceException>(() => pipeline.RegisterStage("Stage").WithEvent(null));
        }