public StepInstanceTemplate(ScenarioStep scenarioStep, ScenarioOutline scenarioOutline, Feature feature, StepContext stepContext, INativeSuggestionItemFactory <TNativeSuggestionItem> nativeSuggestionItemFactory)
        {
            StepDefinitionType = (StepDefinitionType)scenarioStep.ScenarioBlock;
            Language           = stepContext.Language;

            NativeSuggestionItem = nativeSuggestionItemFactory.Create(scenarioStep.Text, StepInstance <TNativeSuggestionItem> .GetInsertionText(scenarioStep), 1, StepDefinitionType.ToString().Substring(0, 1) + "-t", this);
            instances            = new StepSuggestionList <TNativeSuggestionItem>(nativeSuggestionItemFactory);
            AddInstances(scenarioStep, scenarioOutline, feature, stepContext, nativeSuggestionItemFactory);

            var match = paramRe.Match(scenarioStep.Text);

            StepPrefix = match.Success ? scenarioStep.Text.Substring(0, match.Index) : scenarioStep.Text;
        }
Beispiel #2
0
 public StepInstanceWithProjectScope(StepInstance stepInstance, VsProjectScope projectScope)
 {
     StepInstance = stepInstance;
     ProjectScope = projectScope;
 }
Beispiel #3
0
            private StepInstanceTemplate <TNativeSuggestionItem> GetParentTemplate(IBoundStepSuggestion <TNativeSuggestionItem> stepSuggestion)
            {
                StepInstance <TNativeSuggestionItem> stepInstance = stepSuggestion as StepInstance <TNativeSuggestionItem>;

                return(stepInstance != null ? stepInstance.ParentTemplate : null);
            }
Beispiel #4
0
 private CultureInfo GetBindingCulture(StepInstance stepInstance)
 {
     return(GetBindingCulture(stepInstance.StepContext.Language));
 }
Beispiel #5
0
 private IEnumerable <BoundStepSuggestions <TNativeSuggestionItem> > GetMatchingBoundStepSuggestions(StepInstance stepInstance)
 {
     return(boundStepSuggestions.GetMatchingItems(stepInstance.Text).Where(it => BindingMatchService.Match(it.StepBinding, stepInstance, GetBindingCulture(stepInstance), useRegexMatching: false, useParamMatching: false).Success));
 }
Beispiel #6
0
        public void AddStepInstance(StepInstance <TNativeSuggestionItem> stepInstance)
        {
            var matchingItems = GetMatchingBoundStepSuggestions(stepInstance);

            AddStepSuggestionToMatchingItems(stepInstance.StepDefinitionType, matchingItems, item => item.AddSuggestion(stepInstance));
        }