Ejemplo n.º 1
0
        public void TestTableWithColumnsAndNoRows()
        {
            var table = FileBuilder.ParseDatatable(
                "datatable MyTable\r\n" +
                "|___| Ax | By    |\r\n" +
                "|   | 10 | True  |\r\n" +
                "|   | 63 | False |\r\n" +
                "|   | 24 | False |\r\n");

            Assert.AreEqual(2L, table.ColumnCount);
            Assert.AreEqual(3L, table.RowCount);

            Assert.AreEqual("Ax", table.GetColumn(0).Name);
            Assert.IsNull(table.GetColumn(0).Reference);
            Assert.IsNull(table.GetColumn(0).CellType);

            Assert.AreEqual("By", table.GetColumn(1).Name);
            Assert.IsNull(table.GetColumn(1).Reference);
            Assert.IsNull(table.GetColumn(1).CellType);

            Assert.AreEqual("10", table.GetCell(0, 0).CellText);
            Assert.AreEqual("63", table.GetCell(0, 1).CellText);
            Assert.AreEqual("24", table.GetCell(0, 2).CellText);
            Assert.AreEqual("True", table.GetCell(1, 0).CellText);
            Assert.AreEqual("False", table.GetCell(1, 1).CellText);
            Assert.AreEqual("False", table.GetCell(1, 2).CellText);
        }
Ejemplo n.º 2
0
 public void TestEmptyTable()
 {
     FileBuilder.ParseDatatable("datatable MyTable;\r\n");
 }