Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
 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;
 }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
 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);
 }
Ejemplo n.º 5
0
        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);
        }
Ejemplo n.º 6
0
        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);
        }
Ejemplo n.º 7
0
        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;
        }