Exemplo n.º 1
0
 private List <List <string> > RetrieveParameterValues(SpecflowStepInfo stepDefinitionInfo, string partialStepText, string fullStepText, List <(StepPatternTokenType tokenType, string text, bool optional)> tokenizedStepPattern)
Exemplo n.º 2
0
        public IEnumerable <string> ExpandMatchingStepPatternWithAllPossibleParameter(SpecflowStepInfo stepDefinitionInfo, string partialStepText, string fullStepText)
        {
            var matchedText = string.Empty;

            if (partialStepText.Length > 0)
            {
                var result = stepDefinitionInfo.RegexForPartialMatch?.Match(ParseContext.Create(partialStepText), successOnAnyState: true);
                if (result == null || result.Position != 0)
                {
                    return(EmptyList <string> .Enumerable);
                }
                matchedText = result.Value;
            }

            var tokenizedStepPattern = TokenizeStepPattern(stepDefinitionInfo.Pattern).ToList();
            var captureValues        = RetrieveParameterValues(stepDefinitionInfo, partialStepText, fullStepText, tokenizedStepPattern);

            var stringBuilder = new StringBuilder();
            var results       = new List <string>();

            BuildAllPossibleSteps(matchedText, stringBuilder, results, tokenizedStepPattern.ToArray(), captureValues, 0, 0);
            return(results);
        }