Exemplo n.º 1
0
 public RunnableScenario(ScenarioInfo scenario, Func <ExtendableExecutor, object, RunnableStep[]> stepsProvider, Func <object> contextProvider, IScenarioProgressNotifier progressNotifier, ExtendableExecutor extendableExecutor)
 {
     _scenario           = scenario;
     _stepsProvider      = stepsProvider;
     _contextProvider    = contextProvider;
     _progressNotifier   = progressNotifier;
     _extendableExecutor = extendableExecutor;
     _result             = new ScenarioResult(_scenario);
 }
Exemplo n.º 2
0
 public RunnableStep(StepInfo stepInfo, Func <object, object[], Task> stepInvocation, MethodArgument[] arguments, Func <Exception, ExecutionStatus> exceptionToStatusMapper, IScenarioProgressNotifier progressNotifier, ExtendableExecutor extendableExecutor, object scenarioContext)
 {
     _result                  = new StepResult(stepInfo);
     _stepInvocation          = stepInvocation;
     _arguments               = arguments;
     _exceptionToStatusMapper = exceptionToStatusMapper;
     _progressNotifier        = progressNotifier;
     _extendableExecutor      = extendableExecutor;
     _scenarioContext         = scenarioContext;
     UpdateNameDetails();
 }
Exemplo n.º 3
0
        private RunnableStep[] ProvideSteps(ExtendableExecutor extendableExecutor, object scenarioContext)
        {
            var    descriptors          = _steps.ToArray();
            var    totalStepsCount      = descriptors.Length;
            string previousStepTypeName = null;
            var    result = new RunnableStep[totalStepsCount];

            for (int i = 0; i < totalStepsCount; ++i)
            {
                var step = ToRunnableStep(descriptors[i], i, totalStepsCount, previousStepTypeName, extendableExecutor, scenarioContext);
                result[i]            = step;
                previousStepTypeName = step.Result.Info.Name.StepTypeName?.OriginalName;
            }

            return(result);
        }
Exemplo n.º 4
0
 public ScenarioExecutor(ExtendableExecutor extendableExecutor)
 {
     _extendableExecutor = extendableExecutor;
 }
Exemplo n.º 5
0
        private RunnableStep ToRunnableStep(StepDescriptor descriptor, int stepIndex, int totalStepsCount, string previousStepTypeName, ExtendableExecutor extendableExecutor, object scenarioContext)
        {
            var stepInfo  = new StepInfo(_metadataProvider.GetStepName(descriptor, previousStepTypeName), stepIndex + 1, totalStepsCount);
            var arguments = descriptor.Parameters.Select(p => new MethodArgument(p, _metadataProvider.GetParameterFormatter(p.ParameterInfo))).ToArray();

            return(new RunnableStep(stepInfo, descriptor.StepInvocation, arguments, _exceptionToStatusMapper, _progressNotifier, extendableExecutor, scenarioContext));
        }