예제 #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);
                }
        }
예제 #2
0
 public void SetTestData(Table table)
 {
     Parameters.Add(table);
 }
예제 #3
0
 public void IHaveAStepTable(Table table)
 {
     Assert.NotNull(table);
     Assert.NotNull(table.HeaderRow);
     Assert.NotNull(table.DataRows);
     Assert.AreEqual(2, table.DataRows.Count);
 }
예제 #4
0
 public void IHaveACommonStep(Table table)
 {
     Assert.NotNull(table);
     Assert.NotNull(table.HeaderRow);
     Assert.NotNull(table.DataRows);
 }
예제 #5
0
파일: Table.cs 프로젝트: ihenehan/Behavior
        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;
        }
예제 #6
0
        public string InsertValue(Table table, string parameter, int row)
        {
            var key = parameter.Replace("<", "").Replace(">", "");

            return table.GetCellValue(key, row);
        }