Esempio n. 1
0
        public void TestDeprecatedMethods()
        {
            HSSFWorkbook wb    = new HSSFWorkbook();
            HSSFSheet    sheet = wb.CreateSheet() as HSSFSheet;
            HSSFRow      row   = sheet.CreateRow(0) as HSSFRow;
            HSSFCell     cell  = row.CreateCell(0) as HSSFCell;

            // cover some deprecated methods and other smaller stuff...
            Assert.AreEqual(wb.Workbook, cell.BoundWorkbook);
            //cell.getCellNum();
            //cell.setCellNum((short)0);

            try
            {
                CellType t = cell.CachedFormulaResultType;
                Assert.Fail("Should catch exception");
            }
            catch (InvalidOperationException)
            {
            }

            try
            {
                Assert.IsNotNull(new HSSFCell(wb, sheet, 0, (short)0, CellType.Error + 1));
                Assert.Fail("Should catch exception");
            }
            catch (Exception)
            {
            }

            cell.RemoveCellComment();
            cell.RemoveCellComment();
        }