private IEnumerable<string> GetPrefixesToRemove(StepDefinitionType stepDefinitionType) { yield return stepDefinitionType.ToString(); var cultureToSearch = runtimeConfiguration.BindingCulture ?? runtimeConfiguration.FeatureLanguage; foreach (var keyword in LanguageHelper.GetKeywords(cultureToSearch, stepDefinitionType)) { if (keyword.Contains(' ')) { yield return keyword.Replace(" ", "_"); yield return keyword.Replace(" ", ""); } else { yield return keyword; } } }
private IEnumerable <string> GetPrefixesToRemove(StepDefinitionType stepDefinitionType) { yield return(stepDefinitionType.ToString()); var cultureToSearch = runtimeConfiguration.BindingCulture ?? runtimeConfiguration.FeatureLanguage; foreach (var keyword in LanguageHelper.GetKeywords(cultureToSearch, stepDefinitionType)) { if (keyword.Contains(' ')) { yield return(keyword.Replace(" ", "_")); yield return(keyword.Replace(" ", "")); } else { yield return(keyword); } } }
public BoundStepSuggestions(IStepDefinitionBinding stepBinding, INativeSuggestionItemFactory <TNativeSuggestionItem> nativeSuggestionItemFactory) { if (stepBinding == null) { throw new ArgumentNullException("stepBinding"); } StepBinding = stepBinding; StepDefinitionType = stepBinding.StepDefinitionType; string suggestionText = GetSuggestionText(stepBinding); NativeSuggestionItem = nativeSuggestionItemFactory.Create(suggestionText, GetInsertionText(StepBinding), 0, StepDefinitionType.ToString().Substring(0, 1) + "-b", this); suggestions = new StepSuggestionList <TNativeSuggestionItem>(nativeSuggestionItemFactory); }
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; }
public StepInstance(ScenarioStep step, Feature feature, StepContext stepContext, INativeSuggestionItemFactory <TNativeSuggestionItem> nativeSuggestionItemFactory, int level = 1) : base((StepDefinitionType)step.ScenarioBlock, (StepDefinitionKeyword)step.StepKeyword, step.Keyword, step.Text, stepContext) { this.NativeSuggestionItem = nativeSuggestionItemFactory.Create(step.Text, GetInsertionText(step), level, StepDefinitionType.ToString().Substring(0, 1), this); this.FilePosition = step.FilePosition; this.SourceFile = feature.SourceFile; }