Beispiel #1
0
        public async Task ExecutePipeline_SingleStepInPipeline_CallsStep()
        {
            var command         = new BuyItemCommand();
            var updateStockStep = new UpdateStockStep();
            var builder         = new BuyItemPipelineBuilder(updateStockStep);
            var pipeline        = builder.CreatePipeline(command);

            await pipeline.ExecuteAsync();

            Assert.IsTrue(updateStockStep.WasCalled);
        }
Beispiel #2
0
        public async Task ExecutePipeline_MultipleStepsInPipeline_CallsEveryStep()
        {
            var command              = new BuyItemCommand();
            var updateStockStep      = new UpdateStockStep();
            var chargeCreditCardStep = new ChargeCreditCard();
            var steps    = new IStep <BuyItemCommand>[] { updateStockStep, chargeCreditCardStep };
            var builder  = new BuyItemPipelineBuilder(steps);
            var pipeline = builder.CreatePipeline(command);

            await pipeline.ExecuteAsync();

            Assert.IsTrue(updateStockStep.WasCalled);
            Assert.IsTrue(chargeCreditCardStep.WasCalled);
        }