コード例 #1
0
        private static void RemoveAutoGeneratedStepsThatDuplicateUserSteps(string file, NodeFeature feature)
        {
            string[]             contents = File.ReadAllLines(file);
            StepDefinitionParser parser   = new StepDefinitionParser();
            List <FeatureGroup>  groups   = parser.Parse(contents);
            var filterGroup = groups.FirstOrDefault(featureGroup => featureGroup.FeatureName == feature.Name);

            if (filterGroup != null)
            {
                foreach (var scenario in feature.Scenarios)
                {
                    foreach (var filterStep in filterGroup.Steps)
                    {
                        scenario.Steps.RemoveAll(step => step.Equals(filterStep));
                    }
                }
            }
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: SCRUMdifferent/specflowC
 private static void RemoveAutoGeneratedStepsThatDuplicateUserSteps(string file, NodeFeature feature)
 {
     string[] contents = File.ReadAllLines(file);
     StepDefinitionParser parser = new StepDefinitionParser();
     List<FeatureGroup> groups = parser.Parse(contents);
     var filterGroup = groups.FirstOrDefault(featureGroup => featureGroup.FeatureName == feature.Name);
     if (filterGroup != null)
     {
         foreach (var scenario in feature.Scenarios)
         {
             foreach (var filterStep in filterGroup.Steps)
             {
                 scenario.Steps.RemoveAll(step => step.Equals(filterStep));
             }
         }
     }
 }