public async Task AsyncPipeAddAllTypesExecutorsWithSkip()
        {
            var execIncOne     = new IntModelIncrementOneEtor();
            var execIncTwo     = new IntModelIncrementTwoEtor();
            var execIncTwo1    = new IntModelIncrementTwoEtor();
            var funcExecIncOne = ExecutorFactory.GetFuncIntModelIncrementOneEtor();
            var funcExecIncTwo = ExecutorFactory.GetFuncIntModelIncrementTwoEtor();
            var funcDefault    = ExecutorFactory.GetFuncDefaultEtor();

            var pipe = PipeBuilder
                       .AsyncPipe <IntModel, int>()
                       .Executor(execIncOne).Label("exec_1").Add()
                       .Executor(execIncTwo, true).Label("exec_2").Add()
                       .Executor(execIncTwo1, false).Label("exec_21").Add() // skip
                       .Executor(funcExecIncOne).Label("exec_3").Add()
                       .Executor(funcExecIncTwo, true).Label("exec_4").Add()
                       .Executor(async(model) =>
            {
                var value      = await Task.FromResult <int>(10);
                model.Integer += value;
                return(PipeResult <int>
                       .DefaultSuccessful
                       .SetValue(model.Integer));
            }).Label("exec_5").Add()
                       .Executor((model) =>
            {
                model.Integer += 20;
                return(PipeResult <int>
                       .DefaultSuccessful
                       .SetValue(model.Integer));
            }).Label("exec_6").Add()
                       .Default(funcDefault).Add()
                       .Return((model, results) =>
            {
                if (results.Length < 7)
                {
                    return(PipeResult <int>
                           .DefaultUnSuccessful
                           .SetValue(model.Integer));
                }
                if (results.Sum(x => x.Value) < 136)
                {
                    return(PipeResult <int>
                           .DefaultUnSuccessful
                           .SetValue(model.Integer));
                }

                return(PipeResult <int>
                       .DefaultSuccessful
                       .SetValue(model.Integer));
            });

            var integer = new IntModel {
                Integer = 10
            };
            var result = await pipe.ExecuteAsync(integer);

            Assert.Equal(ExecutionResult.Successful, result.Success);
            Assert.True(result.Value >= 136);
        }
        public async Task AsyncPipeAddAllTypesWithCacheExecutors()
        {
            var execIncOne  = new IntModelIncrementOneEtor();
            var execIncTwo  = new IntModelIncrementTwoEtor();
            var funcDefault = ExecutorFactory.GetFuncDefaultCacheEtor();

            var pipe = PipeBuilder
                       .AsyncPipe <IntModel, int>()
                       .Cache(false)
                       .Executor(execIncOne).Label("exec_1").Add()
                       .Executor(execIncTwo).Label("exec_2").Add()
                       .Executor(async(model, cache) =>
            {
                var value      = await Task.FromResult <int>(10);
                model.Integer += value;
                cache.SetSafely <int>("3", model.Integer);
                return(PipeResult <int>
                       .DefaultSuccessful
                       .SetValue(model.Integer));
            }).Label("exec_5").Add()
                       .Executor((model, cache) =>
            {
                model.Integer += 20;
                cache.SetSafely <int>("4", model.Integer);
                return(PipeResult <int>
                       .DefaultSuccessful
                       .SetValue(model.Integer));
            }).Label("exec_6").Add()
                       .Default(funcDefault).Add()
                       .Return((model, results) =>
            {
                if (results.Length < 5)
                {
                    return(PipeResult <int>
                           .DefaultUnSuccessful
                           .SetValue(model.Integer));
                }
                if (results.Sum(x => x.Value) < 83)
                {
                    return(PipeResult <int>
                           .DefaultUnSuccessful
                           .SetValue(model.Integer));
                }

                return(PipeResult <int>
                       .DefaultSuccessful
                       .SetValue(model.Integer));
            });

            var integer = new IntModel {
                Integer = 0
            };
            var result = await pipe.ExecuteAsync(integer);

            Assert.Equal(ExecutionResult.Successful, result.Success);
            Assert.True(result.Value >= 83);
        }