Пример #1
0
        public void Execute(IProcessSteps stepProcessor, IProcessScenarioHooks hookProcessor, IFormatOutput outputFormatter, int lineNumber)
        {
            var executor = GetExecutableAt(lineNumber);

            if (!(executor is Feature))
                outputFormatter.WriteFeatureHeading(this);

            executor.Execute(stepProcessor, hookProcessor, outputFormatter);
        }
Пример #2
0
        public void Execute(IProcessSteps stepProcessor, IProcessScenarioHooks hookProcessor, IFormatOutput outputFormatter)
        {
            outputFormatter.WriteFeatureHeading(this);
            outputFormatter.SkipWritingBackground = false;

            foreach (var item in Items)
            {
                item.Execute(stepProcessor, hookProcessor, outputFormatter);
            }
        }
Пример #3
0
 public override void Execute(IProcessSteps stepProcessor, IProcessScenarioHooks hookProcessor, IFormatOutput outputFormatter)
 {
     hookProcessor.ProcessBeforeScenarioHooks(Tags);
     if(Feature.Background != null)
         Feature.Background.Execute(stepProcessor, hookProcessor, outputFormatter);
     outputFormatter.SkippingSteps = false;
     outputFormatter.WriteScenarioTitle(this);
     foreach (var step in Steps)
     {
         step.Execute(stepProcessor, hookProcessor, outputFormatter);
     }
     var result = new ScenarioResult(null); //TODO: Load an appropriate scenarioResult here...
     hookProcessor.ProcessAfterScenarioHooks(Tags, result);
     outputFormatter.WriteLineBreak();
 }
Пример #4
0
        public void Execute(IProcessSteps stepProcessor, IProcessScenarioHooks hookProcessor, IFormatOutput outputFormatter)
        {
            //if step is in background, and background has ran once,then dont write it.
            if (StepSequence is Background && outputFormatter.SkipWritingBackground)
            {
               stepProcessor.ProcessStep(this);
                return;
            }

            if (!(StepSequence is Background))
                outputFormatter.SkipWritingBackground = true;

            if (outputFormatter.SkippingSteps)
            {
                outputFormatter.WriteSkippedFeatureLine(this);
                stepProcessor.CheckForMissingStep(this);
                return;
            }
            outputFormatter.SkippingSteps = true;
            var result = stepProcessor.ProcessStep(this);

            switch (result.ResultCode)
            {
                case StepRunResultCode.Passed:
                    outputFormatter.SkippingSteps = false;
                    outputFormatter.WritePassedFeatureLine(this, result.MatchedStepDefinition);
                    break;
                case StepRunResultCode.Failed:
                    outputFormatter.WriteException(this, result.Exception);
                    break;
                case StepRunResultCode.Pending:
                    outputFormatter.WritePendingFeatureLine(this, result.Exception);
                    break;
                case StepRunResultCode.Missing:
                    outputFormatter.WriteMissingFeatureLine(this);
                    break;
                default:
                    throw new ArgumentOutOfRangeException();
            }
        }
Пример #5
0
        public void Execute(IProcessSteps stepProcessor, IProcessScenarioHooks hookProcessor, IFormatOutput outputFormatter, IDictionary<string, string> dictionary)
        {
            var newBody = Body;

            foreach (var key in dictionary.Keys)
                newBody = newBody.Replace("<" + key + ">", dictionary[key]);

            var newFeatureStep = new Step(this) { Body = newBody };
            newFeatureStep.Execute(stepProcessor, hookProcessor, outputFormatter);
        }
Пример #6
0
 public abstract void Execute(IProcessSteps stepProcessor, IProcessScenarioHooks hookProcessor, IFormatOutput outputFormatter);