コード例 #1
0
 public TestResult GetScenarioResult(Scenario scenario)
 {
     CucumberObjects.Element cucumberScenario = null;
     CucumberObjects.Feature cucumberFeature  = this.GetFeatureElement(scenario.Feature);
     if (cucumberFeature != null)
     {
         cucumberScenario = cucumberFeature.elements.FirstOrDefault(x => x.name == scenario.Name);
     }
     return(this.GetResultFromScenario(cucumberScenario));
 }
コード例 #2
0
        private TestResult GetResultFromScenario(CucumberObjects.Element cucumberScenario)
        {
            if (cucumberScenario == null)
            {
                return(TestResult.Inconclusive);
            }

            bool wasSuccessful = CheckScenarioStatus(cucumberScenario);

            return(wasSuccessful ? TestResult.Passed : TestResult.Failed);
        }
コード例 #3
0
 private static bool CheckScenarioStatus(CucumberObjects.Element cucumberScenario)
 {
     return(cucumberScenario.steps.All(x => x.result.status == "passed"));
 }