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

            Position p = cellTable.GetLastPosition();

            Assert.AreEqual(p, new Position(0, 8));

            cellTable.Width = 3;
            p = cellTable.GetLastPosition();
            Assert.AreEqual(p, new Position(2, 2));
        }
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");
            }
        }