Beispiel #1
0
        public void SetTestData(Table table, int row)
        {
            if (table != null && row > -1)
                for (int i = 0; i < Parameters.Count; i++)
                {
                    var key = Parameters[i].ToString().Replace("<", "").Replace(">", "");

                    if (Parameters[i].ToString().StartsWith("<") && Parameters[i].ToString().EndsWith(">"))
                        Parameters[i] = table.GetCellValue(key, row);
                }
        }
Beispiel #2
0
 public void SetTestData(Table table)
 {
     Parameters.Add(table);
 }
Beispiel #3
0
 public void IHaveAStepTable(Table table)
 {
     Assert.NotNull(table);
     Assert.NotNull(table.HeaderRow);
     Assert.NotNull(table.DataRows);
     Assert.AreEqual(2, table.DataRows.Count);
 }
Beispiel #4
0
 public void IHaveACommonStep(Table table)
 {
     Assert.NotNull(table);
     Assert.NotNull(table.HeaderRow);
     Assert.NotNull(table.DataRows);
 }
Beispiel #5
0
        public Table Parse(List<string> lines, ref int currentLine)
        {
            var table = new Table();

            if (lines[currentLine].StartsWith(LanguageElements.TableDelimiter))
            {
                var split = lines[currentLine].Split(LanguageElements.TableDelimiter.ToCharArray()).ToList();

                foreach (string h in split)
                    if (!string.IsNullOrEmpty(h))
                        table.HeaderRow.Add(h.Trim());

                currentLine++;
            }

            while (lines[currentLine].StartsWith(LanguageElements.TableDelimiter))
            {
                var split = lines[currentLine].Split(LanguageElements.TableDelimiter.ToCharArray()).ToList();

                split.RemoveAll(c => string.IsNullOrEmpty(c));

                table.AddRowData(split.ToArray());

                if (currentLine == lines.Count - 1)
                    lines[currentLine] = "<EOF>";
                else
                    currentLine++;
            }

            return table;
        }
Beispiel #6
0
        public string InsertValue(Table table, string parameter, int row)
        {
            var key = parameter.Replace("<", "").Replace(">", "");

            return table.GetCellValue(key, row);
        }