private FeatureResult GetFeatureResult(IEnumerable <ScenarioResult> scenarioResults) { var title = scenarioResults.Select(_ => _.FeatureTitle).FirstOrDefault() ?? ""; var featureResult = new FeatureResult(title); foreach (var result in scenarioResults) { featureResult.AddResult(result); } return(featureResult); }
public FeatureResult Run(Feature feature) { var featureResult = new FeatureResult(feature.Title); foreach (var scenario in feature.Scenarios) { var backgroundResults = RunBackground(scenario.Feature.Background); context.ScenarioStartedEvent(scenario); ScenarioResult scenarioResult = scenario.Examples.Any() ? RunExamples(scenario) : RunScenario(scenario); scenarioResult.AddActionStepResults(backgroundResults); featureResult.AddResult(scenarioResult); context.ScenarioFinishedEvent(scenarioResult); } return featureResult; }
public FeatureResult Run(Feature feature) { var featureResult = new FeatureResult(feature.Title); foreach (var scenario in feature.Scenarios) { var backgroundResults = RunBackground(scenario.Feature.Background); context.ScenarioStartedEvent(scenario); ScenarioResult scenarioResult = scenario.Examples.Any() ? RunExamples(scenario) : RunScenario(scenario); scenarioResult.AddActionStepResults(backgroundResults); featureResult.AddResult(scenarioResult); context.ScenarioFinishedEvent(scenarioResult); } return(featureResult); }
public void EstablishContext() { _writer = new StringWriter(); _output = new SummaryWriter(_writer); var feature = new Feature("feature title"); var featureResult = new FeatureResult(feature.Title); var scenarioResult = new ScenarioResult(feature, "scenario title"); scenarioResult.AddActionStepResult(new StepResult("a".AsStringStep(""), new Passed())); scenarioResult.AddActionStepResult(new StepResult("b".AsStringStep(""), new Passed())); scenarioResult.AddActionStepResult(new StepResult("c".AsStringStep(""), new Pending("pending reason"))); scenarioResult.AddActionStepResult(new StepResult("c".AsStringStep(""), new PendingNotImplemented("not implemented"))); scenarioResult.AddActionStepResult(new StepResult("d".AsStringStep(""), new Failed(new Exception("why it failed")))); scenarioResult.AddActionStepResult(new StepResult("c".AsStringStep(""), new Skipped("previous step failed"))); featureResult.AddResult(scenarioResult); _output.WriteSummaryResults(featureResult); }
public FeatureResult Run(Feature feature) { var featureResult = new FeatureResult(feature.Title); foreach (var scenario in feature.Scenarios) { var backgroundResults = RunBackground(scenario.Feature.Background); var scenarioResult = BeforeScenario(scenario); scenarioResult.AddActionStepResults(backgroundResults); if (!scenarioResult.HasFailed) { scenarioResult = scenario.Examples.Any() ? RunExamples(scenario) : RunScenario(scenario); } AfterScenario(scenarioResult); featureResult.AddResult(scenarioResult); } return(featureResult); }
private FeatureResult GetFeatureResult(IEnumerable<ScenarioResult> scenarioResults) { var title = scenarioResults.Select(_ => _.FeatureTitle).FirstOrDefault() ?? ""; var featureResult = new FeatureResult(title); foreach (var result in scenarioResults) featureResult.AddResult(result); return featureResult; }