Пример #1
0
        public static List <Step> ConvertScenarioToElementarySteps(this Step step, ScenarioLoader scenarioLoader)
        {
            var scenario = scenarioLoader.GetScenario(step.Param);

            //foreach (var scenarioStep in scenario.Steps)
            for (int index = 0; index < scenario.Steps.Count; index++)
            {
                if (scenario.Steps[index].Type == StepType.EXECUTE_SCENARIO)
                {
                    var elementarySteps = scenario.Steps[index].ConvertScenarioToElementarySteps(scenarioLoader);
                    var contextToApply  = ContextLoader.Instance.GetContext(scenario.Steps[index].Value);
                    elementarySteps.ForEach(s => s.ApplyScenarioContext(contextToApply));
                    scenario.Steps.Remove(scenario.Steps[index]);
                    scenario.Steps.InsertRange(index, elementarySteps);
                }
            }
            return(scenario.Steps);
        }
Пример #2
0
 public static Test ConvertScenarioToElementarySteps(this Test test, ContextLoader contextLoader, ScenarioLoader scenarioLoader)
 {
     //foreach (var step in test.Steps)
     for (int index = 0; index < test.Steps.Count; index++)
     {
         if (test.Steps[index].Type == StepType.EXECUTE_SCENARIO)
         {
             var elementarySteps = test.Steps[index].ConvertScenarioToElementarySteps(scenarioLoader);
             var contextToApply  = contextLoader.GetContext(test.Steps[index].Value);
             elementarySteps.ForEach(s => s.ApplyScenarioContext(contextToApply));
             test.Steps.Remove(test.Steps[index]);
             test.Steps.InsertRange(index, elementarySteps);
         }
     }
     return(test);
 }