public bool Match(StepScope stepScope, out int scopeMatches) { scopeMatches = 0; var tags = stepScope.Tags ?? emptyTagList; if (Tag != null) { if (!tags.Contains(Tag)) { return(false); } scopeMatches++; } if (FeatureTitle != null) { if (!string.Equals(FeatureTitle, stepScope.FeatureTitle, StringComparison.CurrentCultureIgnoreCase)) { return(false); } scopeMatches++; } if (ScenarioTitle != null) { if (!string.Equals(ScenarioTitle, stepScope.ScenarioTitle, StringComparison.CurrentCultureIgnoreCase)) { return(false); } scopeMatches++; } return(true); }
public StepInstance(BindingType bindingType, StepDefinitionKeyword stepDefinitionKeyword, string keyword, string stepText, StepScope stepScope) { BindingType = bindingType; StepDefinitionKeyword = stepDefinitionKeyword; Keyword = keyword; Text = stepText; StepScope = stepScope; }
public void Step(string keyword, StepKeyword stepKeyword, Parser.Gherkin.ScenarioBlock scenarioBlock, string text, GherkinBufferSpan stepSpan) { ColorizeKeywordLine(keyword, stepSpan, classifications.StepText); if (CurrentFileBlockBuilder.BlockType == typeof(IScenarioOutlineBlock)) { var matches = placeholderRe.Matches(text); foreach (Match match in matches) ColorizeLinePart(match.Value, stepSpan, classifications.Placeholder); } var editorLine = stepSpan.StartPosition.Line; var tags = FeatureTags.Concat(CurrentFileBlockBuilder.Tags).Distinct(); var stepScope = new StepScope(FeatureTitle, CurrentFileBlockBuilder.BlockType == typeof(IBackgroundBlock) ? null : CurrentFileBlockBuilder.Title, tags.ToArray()); currentStep = new GherkinStep((BindingType)scenarioBlock, (StepDefinitionKeyword)stepKeyword, text, stepScope, keyword, editorLine - CurrentFileBlockBuilder.KeywordLine); CurrentFileBlockBuilder.Steps.Add(currentStep); }
public bool Match(StepScope stepScope) { int dummy; return(Match(stepScope, out dummy)); }