コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
 private static GherkinTable ConvertToCompatibleExamplesTable(global::Gherkin.Ast.Examples examples)
 {
     return(new GherkinTable(ConvertToCompatibleRow(examples.TableHeader), examples.TableBody.Select(ConvertToCompatibleRow).ToArray()));
 }