private StringStep CreateStringStep(ScenarioFragment currentStage, string step) { string stepType = currentStage.ToString(); if (Scenario.Steps.Any() && previousStage == currentStage) { stepType = "And"; } var stringStep = new StringStep(stepType, step, Scenario.Source); return(stringStep); }
private void RunStep(ScenarioFragment currentStage, string step, StringStep stringStep) { var stepToRun = new StringStep(currentStage.ToString(), step, Scenario.Source); try { RunHooks <BeforeStepAttribute>(); } catch (Exception e) { stringStep.StepResult = new StepResult(stringStep, new Failed(e)); } try { StepRunner.Run(stepToRun); stringStep.StepResult = new StepResult(stringStep, stepToRun.StepResult.Result); } finally { RunHooks <AfterStepAttribute>(); } }