예제 #1
0
 public PickleStep(PickleStepArgument argument, IEnumerable <string> astNodeIds, string id, string text, StepKeywordType type)
 {
     Id         = id;
     Text       = text;
     Argument   = argument;
     AstNodeIds = astNodeIds.ToReadOnlyCollection();
     Type       = type;
 }
예제 #2
0
 public Step(Location location, string keyword, StepKeywordType keywordType, string text, StepArgument argument)
 {
     Location    = location;
     Keyword     = keyword;
     KeywordType = keywordType;
     Text        = text;
     Argument    = argument;
 }
예제 #3
0
 private void BuildScenario(List <Pickle> pickles, string language, IEnumerable <Tag> tags, Func <IEnumerable <PickleStep> > backgroundStepsFactory, string gherkinDocumentUri, Scenario scenario)
 {
     CurrentStepKeywordType = StepKeywordType.Unspecified;
     if (!scenario.Examples.Any())
     {
         CompileScenario(pickles, backgroundStepsFactory, scenario, tags, language, gherkinDocumentUri);
     }
     else
     {
         CompileScenarioOutline(pickles, backgroundStepsFactory, scenario, tags, language, gherkinDocumentUri);
     }
 }
예제 #4
0
        protected virtual StepKeywordType GetKeywordType(Step step, StepKeywordType lastStepKeywordType)
        {
            var stepKeywordType = step.KeywordType;

            switch (stepKeywordType)
            {
            case StepKeywordType.Context:
            case StepKeywordType.Action:
            case StepKeywordType.Outcome:
            case StepKeywordType.Unknown:
                return(stepKeywordType);

            case StepKeywordType.Conjunction:
                return(lastStepKeywordType == StepKeywordType.Unspecified ||
                       lastStepKeywordType == StepKeywordType.Unknown
                        ? StepKeywordType.Context
                        : lastStepKeywordType);

            default:
                return(StepKeywordType.Unspecified);
            }
        }
예제 #5
0
 protected virtual PickleStep CreatePickleStep(Step step, string text, PickleStepArgument argument, IEnumerable <string> astNodeIds)
 {
     CurrentStepKeywordType = GetKeywordType(step, CurrentStepKeywordType);
     return(new PickleStep(argument, astNodeIds, _idGenerator.GetNewId(), text, CurrentStepKeywordType));
 }