Example #1
0
        private void GenerateStep(CodeStatementCollection statements,
                                  Step scenarioStep,
                                  ParameterSubstitution paramToIdentifier,
                                  TableRow row,
                                  StepKeyword stepKeyWord,
                                  string keyWord)
        {
            var specFlowStep = AsSpecFlowStep(scenarioStep);

            //testRunner.Given("something");
            var arguments = new List <CodeExpression>
            {
                GetSubstitutedString(scenarioStep.Text, paramToIdentifier, row),
                GetDocStringArgExpression(scenarioStep.Argument as DocString, paramToIdentifier, row),
                GetTableArgExpression(scenarioStep.Argument as DataTable, statements, paramToIdentifier, row),
                new CodePrimitiveExpression(keyWord)
            };

            AddLineDirective(statements, scenarioStep);
            statements.Add(new CodeExpressionStatement(
                               new CodeMethodInvokeExpression(
                                   new CodeMethodReferenceExpression(
                                       new CodeVariableReferenceExpression(NamingHelper.TestRunnerVariableName),
                                       stepKeyWord.ToString()),
                                   arguments.ToArray())));
        }
Example #2
0
 public IEnumerable <string> GetStepKeywords(StepKeyword stepKeyword)
 {
     return(NativeLanguageService.keywords(stepKeyword.ToString().ToLowerInvariant()).toArray().Cast <string>());
 }
Example #3
0
 public IEnumerable<string> GetStepKeywords(StepKeyword stepKeyword)
 {
     return NativeLanguageService.keywords(stepKeyword.ToString().ToLowerInvariant()).toArray().Cast<string>();
 }