示例#1
0
 private CultureInfo GetBindingCulture(StepInstance stepInstance)
 {
     return(GetBindingCulture(stepInstance.StepContext.Language));
 }
示例#2
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));
 }
示例#3
0
        public void AddStepInstance(StepInstance <TNativeSuggestionItem> stepInstance)
        {
            var matchingItems = GetMatchingBoundStepSuggestions(stepInstance);

            AddStepSuggestionToMatchingItems(stepInstance.StepDefinitionType, matchingItems, item => item.AddSuggestion(stepInstance));
        }
示例#4
0
 public StepInstanceWithProjectScope(StepInstance stepInstance, VsProjectScope projectScope)
 {
     StepInstance = stepInstance;
     ProjectScope = projectScope;
 }
示例#5
0
        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;
        }
            private StepInstanceTemplate <TNativeSuggestionItem> GetParentTemplate(IBoundStepSuggestion <TNativeSuggestionItem> stepSuggestion)
            {
                StepInstance <TNativeSuggestionItem> stepInstance = stepSuggestion as StepInstance <TNativeSuggestionItem>;

                return(stepInstance != null ? stepInstance.ParentTemplate : null);
            }