Exemple #1
0
        public void Test_CellTable_Creation()
        {
            string    text      = "This    is   A     test  Of   The Cell Table method";
            CellTable cellTable = new CellTable(text);

            Assert.AreEqual(cellTable.NumItems, 9);
            var table = cellTable.GetTable();

            Assert.AreEqual(table[0, 0].Text, "This");
            Assert.AreEqual(table[0, 1].Value, (int)'i');
            Assert.AreEqual(table[0, 7].Value, (int)'t');
            Assert.AreEqual(table[0, 8].Text, "method");
        }
Exemple #2
0
        public void Test_CellTable_SetWidth()
        {
            string    text      = "This    is   A     test  Of   The Cell Table method";
            CellTable cellTable = new CellTable(text);

            for (int i = 1; i < cellTable.NumItems; i++)
            {
                cellTable.Width = i;
                var table = cellTable.GetTable();
                var p     = cellTable.GetLastPosition();
                Assert.AreEqual(table.Length, i * cellTable.Height);
                Assert.AreEqual(table[p.x, p.y].Text, "method");
            }
        }