public void NotifyScenarioStart_should_print_scenario_full_details() { string scenarioName = "scenario name"; string label = "MY-LABEL-1"; string expectedText = string.Format("SCENARIO: [{0}] {1}{2}", label, scenarioName, Environment.NewLine); _subject.NotifyScenarioStart(scenarioName, label); Assert.That(_console.GetCapturedText(), Is.EqualTo(expectedText)); }
public void Execute(Scenario scenario, IEnumerable <IStep> steps) { _progressNotifier.NotifyScenarioStart(scenario.Name, scenario.Label); var stepsToExecute = PrepareSteps(scenario, steps); var watch = new Stopwatch(); var scenarioStartTime = DateTimeOffset.UtcNow; try { ExecutionContext.Instance = new ExecutionContext(_progressNotifier, stepsToExecute.Length); watch.Start(); ExecuteSteps(stepsToExecute); } finally { watch.Stop(); ExecutionContext.Instance = null; var result = new ScenarioResult(scenario.Name, stepsToExecute.Select(s => s.GetResult()), scenario.Label, scenario.Categories) .SetExecutionStart(scenarioStartTime) .SetExecutionTime(watch.Elapsed); if (ScenarioExecuted != null) { ScenarioExecuted.Invoke(result); } _progressNotifier.NotifyScenarioFinished(result); } }