private static Dictionary <string, string> GetExampleRowValues(global::Gherkin.Ast.Examples examples, List <global::Gherkin.Ast.TableCell> exampleRowCells) { var rowValues = new Dictionary <string, string>(); var headerCells = examples.TableHeader.Cells.ToList(); for (int index = 0; index < headerCells.Count; index++) { rowValues.Add(headerCells[index].Value, exampleRowCells[index].Value); } return(rowValues); }
private static List <global::Gherkin.Ast.TableCell> GetExampleRow(global::Gherkin.Ast.ScenarioOutline @this, int exampleRowIndex, global::Gherkin.Ast.Examples examples) { var exampleRows = examples.TableBody.ToList(); if (!(exampleRowIndex < exampleRows.Count)) { throw new InvalidOperationException($"Index out of range. Cannot retrieve example row at index `{exampleRowIndex}`. Example: `{examples.Name}`. Scenario outline: `{@this.Name}`."); } var exampleRow = exampleRows[exampleRowIndex]; var exampleRowCells = exampleRow.Cells.ToList(); return(exampleRowCells); }
private static GherkinTable ConvertToCompatibleExamplesTable(global::Gherkin.Ast.Examples examples) { return(new GherkinTable(ConvertToCompatibleRow(examples.TableHeader), examples.TableBody.Select(ConvertToCompatibleRow).ToArray())); }