예제 #1
0
        private static void SetResultsForIndividualScenariosUnderFeature(FeatureNode featureTreeNode, ITestResults testResults)
        {
            foreach (var featureElement in featureTreeNode.Feature.FeatureElements)
            {
                var scenario = featureElement as Scenario;

                if (scenario != null)
                {
                    featureElement.Result = testResults.GetScenarioResult(scenario);
                    continue;
                }

                var scenarioOutline = featureElement as ScenarioOutline;

                if (scenarioOutline != null)
                {
                    foreach (var example in scenarioOutline.Examples.SelectMany(e => e.TableArgument.DataRows))
                    {
                        example.Result = testResults.GetExampleResult(scenarioOutline, example.Cells.ToArray());
                    }

                    scenarioOutline.Result =
                        scenarioOutline.Examples.SelectMany(e => e.TableArgument.DataRows)
                        .Select(row => row.Result)
                        .Merge();
                }
            }
        }
예제 #2
0
파일: Runner.cs 프로젝트: Jaykul/pickles
        private static void SetResultsForIndividualScenariosUnderFeature(FeatureNode featureTreeNode, ITestResults testResults)
        {
            foreach (var featureElement in featureTreeNode.Feature.FeatureElements)
            {
              var scenario = featureElement as Scenario;

              if (scenario != null)
              {
                featureElement.Result = testResults.GetScenarioResult(scenario);
                continue;
              }

              var scenarioOutline = featureElement as ScenarioOutline;

              if (scenarioOutline != null)
              {
                if (testResults.SupportsExampleResults)
                {
                  foreach (var example in scenarioOutline.Examples.SelectMany(e => e.TableArgument.DataRows))
                  {
                    example.Result = testResults.GetExampleResult(scenarioOutline, example.ToArray());
                  }

                  scenarioOutline.Result =
                    scenarioOutline.Examples.SelectMany(e => e.TableArgument.DataRows).Select(row => row.Result).Merge();
                }
                else
                {
                  featureElement.Result = testResults.GetScenarioOutlineResult(scenarioOutline);
                }
                continue;
              }
            }
        }