Exemplo n.º 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);
                }
        }
Exemplo n.º 2
0
 public void SetTestData(Table table)
 {
     Parameters.Add(table);
 }
Exemplo n.º 3
0
 public void IHaveAStepTable(Table table)
 {
     Assert.NotNull(table);
     Assert.NotNull(table.HeaderRow);
     Assert.NotNull(table.DataRows);
     Assert.AreEqual(2, table.DataRows.Count);
 }
Exemplo n.º 4
0
 public void IHaveACommonStep(Table table)
 {
     Assert.NotNull(table);
     Assert.NotNull(table.HeaderRow);
     Assert.NotNull(table.DataRows);
 }
Exemplo n.º 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;
        }
Exemplo n.º 6
0
        public string InsertValue(Table table, string parameter, int row)
        {
            var key = parameter.Replace("<", "").Replace(">", "");

            return table.GetCellValue(key, row);
        }