Example #1
0
        public void TestGetCellWidth()
        {
            InternalSheet    sheet = InternalSheet.CreateSheet();
            ColumnInfoRecord nci   = new ColumnInfoRecord();

            // Prepare test model
            nci.FirstColumn = 5;
            nci.LastColumn  = 10;
            nci.ColumnWidth = 100;


            sheet._columnInfos.InsertColumn(nci);

            Assert.AreEqual(100, sheet.GetColumnWidth(5));
            Assert.AreEqual(100, sheet.GetColumnWidth(6));
            Assert.AreEqual(100, sheet.GetColumnWidth(7));
            Assert.AreEqual(100, sheet.GetColumnWidth(8));
            Assert.AreEqual(100, sheet.GetColumnWidth(9));
            Assert.AreEqual(100, sheet.GetColumnWidth(10));

            sheet.SetColumnWidth(6, 200);

            Assert.AreEqual(100, sheet.GetColumnWidth(5));
            Assert.AreEqual(200, sheet.GetColumnWidth(6));
            Assert.AreEqual(100, sheet.GetColumnWidth(7));
            Assert.AreEqual(100, sheet.GetColumnWidth(8));
            Assert.AreEqual(100, sheet.GetColumnWidth(9));
            Assert.AreEqual(100, sheet.GetColumnWidth(10));
        }