public StepBuilder(string keyword, StepKeyword stepKeyword, string text, FilePosition position) { switch (stepKeyword) { case StepKeyword.Given: step = new Given(); break; case StepKeyword.When: step = new When(); break; case StepKeyword.Then: step = new Then(); break; case StepKeyword.And: step = new And(); break; case StepKeyword.But: step = new But(); break; default: throw new NotSupportedException(); } step.Keyword = keyword; step.Text = text; step.FilePosition = position; }
public ScenarioBuilder(string name, string description, Tags tags, FilePosition position) { this.title = name; this.description = description; this.position = position; this.tags = tags; }
public BackgroundBuilder(string keyword, string name, string description, FilePosition position) { this.keyword = keyword; this.name = name; this.description = description; this.position = position; }
public void SetHeader(string keyword, string title, string description, Tags tags, FilePosition position) { this.keyword = keyword; this.title = title; this.description = description; this.tags = tags; this.position = position; }
public ExampleBuilder(string keyword, string name, string description, Tags tags, FilePosition position) { this.keyword = keyword; this.name = name; this.description = description; this.tags = tags; this.position = position; }
public StepBuilder(string keyword, string text, FilePosition position, I18n i18n) { if (i18n.keywords("given").contains(keyword)) step = new Given(); else if (i18n.keywords("when").contains(keyword)) step = new When(); else if (i18n.keywords("then").contains(keyword)) step = new Then(); else if (i18n.keywords("and").contains(keyword)) step = new And(); else if (i18n.keywords("but").contains(keyword)) step = new But(); else throw new ArgumentOutOfRangeException(string.Format("Parameter 'keyword' has value that can not be translated! Value:'{0}'", keyword)); step.Text = text; step.FilePosition = position; }
public void ProcessTableRow(string[] cells, FilePosition rowPosition) { var row = new Row(cells.Select(c => new Cell(c)).ToArray()); row.FilePosition = rowPosition; if (tableRows.Count > 0 && tableRows[0].Cells.Length != row.Cells.Length) { throw new GherkinSemanticErrorException( "Number of cells in the row does not match the number of cells in the header.", row.FilePosition); } tableRows.Add(row); }
public ScenarioOutlineBuilder(string name, string description, Tags tags, FilePosition position) { this.title = TextHelper.GetText(name, description); this.tags = tags; this.position = position; }
public void ProcessTableRow(string[] row, FilePosition rowPosition) { tableBuilder.ProcessTableRow(row, rowPosition); }
public ExampleBuilder(string name, string description, FilePosition position) { this.text = TextHelper.GetText(name, description); this.position = position; }
private void AssertTableProcessor(FilePosition position) { if (tableProcessor == null) throw new GherkinSemanticErrorException( "Table argument can only be specified for steps and examples.", position); }
public void AddComment(string commentText, FilePosition filePosition) { comments.Add(new Comment(commentText, filePosition)); }
public BackgroundBuilder(string text, FilePosition position) { this.text = text; this.position = position; }
public ScenarioOutlineBuilder(string keyword, string name, string description, Tags tags, FilePosition position) : base(keyword, name, description, tags, position) { }
public ScenarioStep CreateStep(string keyword, StepKeyword stepKeyword, string text, FilePosition position, ScenarioBlock scenarioBlock) { ScenarioStep step; switch (stepKeyword) { case StepKeyword.Given: step = new Given(); break; case StepKeyword.When: step = new When(); break; case StepKeyword.Then: step = new Then(); break; case StepKeyword.And: step = new And(); break; case StepKeyword.But: step = new But(); break; default: throw new NotSupportedException(); } step.Keyword = keyword; step.Text = text; step.FilePosition = position; step.ScenarioBlock = scenarioBlock; step.StepKeyword = stepKeyword; return step; }
public ScenarioBuilder(string name, Tags tags, FilePosition position) { this.name = name; this.position = position; this.tags = tags; }
public GherkinSemanticErrorException(string message, FilePosition position) : base(message, position.Line - 1, position.Column - 1) { }
public void ProcessTableRow(string[] cells, FilePosition rowPosition) { tableBuilder.ProcessTableRow(cells, rowPosition); }
public ExampleBuilder(string name, string description, FilePosition position) { this.name = name; this.description = description; this.position = position; }
protected virtual void AppendNodeLine(StringBuilder result, FilePosition filePosition, string textFormat, params object[] args) { result.AppendFormat(textFormat, args); AppendLine(result); }
public ExampleBuilder(string text, FilePosition position) { this.text = text; this.position = position; }