示例#1
0
        private object Act(IFunctionExpression expression,
                           IFunctionParametersFiller functionParametersFiller = null,
                           IFunctionHandlerResolver functionHandlerResolver   = null)
        {
            var executor = new FunctionExpressionExecutor(functionParametersFiller ?? Substitute.For <IFunctionParametersFiller>(),
                                                          functionHandlerResolver ?? Substitute.For <IFunctionHandlerResolver>());

            return(executor.Execute(expression));
        }
示例#2
0
        public FunctionExpressionExecutor(IFunctionParametersFiller functionParametersFiller,
                                          IFunctionHandlerResolver functionHandlerResolver)
        {
            _functionParametersFiller = functionParametersFiller;
            _functionHandlerResolver  = functionHandlerResolver;

            _executeFunctionMethod = new Lazy <MethodInfo>(() => GetType().GetMethod(nameof(ExecuteFunction),
                                                                                     BindingFlags.Instance | BindingFlags.NonPublic));
        }