Exemple #1
0
 public ExampleSet(string keyword, string title, string description, Tags tags, GherkinTable table)
 {
     Keyword     = keyword;
     Title       = title ?? string.Empty;
     Description = description;
     Tags        = tags;
     Table       = table;
 }
Exemple #2
0
 public ExampleSet(string keyword, string title, string description, Tags tags, GherkinTable table)
 {
     Keyword = keyword;
     Title = title ?? string.Empty;
     Description = description ?? "";
     Tags = tags;
     Table = table;
 }
 private static void AddTable(GherkinTable tableArg, StringBuilder formettedScenario)
 {
     formettedScenario.AppendLine("<table class='gherkin-table-arg'>");
     AddTableRow(tableArg.Header, true, formettedScenario);
     foreach (var row in tableArg.Body)
     {
         AddTableRow(row, false, formettedScenario);
     }
     formettedScenario.AppendLine("</table>");
 }
Exemple #4
0
        /// <summary>
        /// Converts the provided <see cref="SpecFlow.GherkinTable"/> instance into a <see cref="Augurk.Entities.Table"/> instance.
        /// </summary>
        /// <param name="gherkinTable">The <see cref="SpecFlow.GherkinTable"/> instance that should be converted.</param>
        /// <returns>The converted <see cref="Augurk.Entities.Table"/> instance.</returns>
        public static Table ConvertToTable(this SpecFlow.GherkinTable gherkinTable)
        {
            if (gherkinTable == null)
            {
                return(null);
            }

            return(new Table
            {
                Columns = gherkinTable.Header.Cells.Select(cell => cell.Value).ToArray(),
                Rows = gherkinTable.Body.Select(row => row.Cells.Select(cell => cell.Value).ToArray()).ToArray()
            });
        }
Exemple #5
0
        private void AppendTable(StringBuilder result, GherkinTable table, string tableIndent)
        {
            int[] widths = new int[table.Header.Cells.Count()];
            CalculateWidth(widths, table.Header);
            foreach (var row in table.Body)
                CalculateWidth(widths, row);

            AppendTableRow(result, table.Header, tableIndent, widths);
            foreach (var row in table.Body)
            {
                AppendTableRow(result, row, tableIndent, widths);
            }
        }
        private GherkinTable Clone(GherkinTable table)
        {
            if (table == null)
                return null;

            return new GherkinTable(Clone(table.Header), table.Body.Select(r => Clone(r)).ToArray());
        }