コード例 #1
0
        public void TestGetAccessors()
        {
            XSSFWorkbook   wb    = XSSFTestDataSamples.OpenSampleWorkbook("chart_sheet.xlsx");
            XSSFChartSheet sheet = (XSSFChartSheet)wb.GetSheetAt(2);

            Assert.IsFalse(sheet.GetEnumerator().MoveNext(),
                           "Row iterator for charts sheets should return zero rows");

            //access to a arbitrary row
            Assert.IsNull(sheet.GetRow(1));

            //some basic get* accessors
            Assert.AreEqual(0, sheet.NumberOfComments);
            Assert.AreEqual(0, sheet.NumHyperlinks);
            Assert.AreEqual(0, sheet.NumMergedRegions);
            Assert.IsNull(sheet.ActiveCell);
            Assert.IsTrue(sheet.Autobreaks);
            Assert.IsNull(sheet.GetCellComment(0, 0));
            Assert.IsNull(sheet.GetCellComment(new CellAddress(0, 0)));
            Assert.AreEqual(0, sheet.ColumnBreaks.Length);
            Assert.IsTrue(sheet.RowSumsBelow);

            Assert.IsNotNull(sheet.CreateDrawingPatriarch());
            Assert.IsNotNull(sheet.GetDrawingPatriarch());
            Assert.IsNotNull(sheet.GetCTChartsheet());
        }