Пример #1
0
        public void TestExternSheetIndex()
        {
            HSSFWorkbook wb = new HSSFWorkbook();
            wb.CreateSheet("Sheet1");
            wb.CreateSheet("Sheet2");

            Assert.AreEqual(0, wb.GetExternalSheetIndex(0));
            Assert.AreEqual(1, wb.GetExternalSheetIndex(1));

            //Assert.AreEqual("Sheet1", wb.FindSheetNameFromExternSheet(0));
            //Assert.AreEqual("Sheet2", wb.FindSheetNameFromExternSheet(1));
            ////Assert.AreEqual(null, wb.FindSheetNameFromExternSheet(2));

            //Assert.AreEqual(0, wb.GetSheetIndexFromExternSheetIndex(0));
            //Assert.AreEqual(1, wb.GetSheetIndexFromExternSheetIndex(1));
            //Assert.AreEqual(-1, wb.GetSheetIndexFromExternSheetIndex(2));
            //Assert.AreEqual(-1, wb.GetSheetIndexFromExternSheetIndex(100));
        }
Пример #2
0
        public void ExternSheetIndex()
        {
            HSSFWorkbook wb = new HSSFWorkbook();
            wb.CreateSheet("Sheet1");
            wb.CreateSheet("Sheet2");

            Assert.AreEqual(0, wb.GetExternalSheetIndex(0));
            Assert.AreEqual(1, wb.GetExternalSheetIndex(1));

            //The following methods are obsoleted

            //Assert.AreEqual("Sheet1", wb.FindSheetNameFromExternSheet(0));
            //Assert.AreEqual("Sheet2", wb.FindSheetNameFromExternSheet(1));
            ////Assert.AreEqual(null, wb.FindSheetNameFromExternSheet(2));

            //Assert.AreEqual(0, wb.GetSheetIndexFromExternSheetIndex(0));
            //Assert.AreEqual(1, wb.GetSheetIndexFromExternSheetIndex(1));
            //Assert.AreEqual(-1, wb.GetSheetIndexFromExternSheetIndex(2));
            //Assert.AreEqual(-1, wb.GetSheetIndexFromExternSheetIndex(100));
        }