Exemple #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());
        }
Exemple #2
0
        public void TestGetAccessors()
        {
            XSSFWorkbook   wb    = XSSFTestDataSamples.OpenSampleWorkbook("chart_sheet.xlsx");
            XSSFChartSheet sheet = (XSSFChartSheet)wb.GetSheetAt(2);

            //foreach (IRow row in sheet)
            //{
            //    fail("Row iterator for charts sheets should return zero rows");
            //}

            //access to a arbitrary row
            Assert.AreEqual(null, sheet.GetRow(1));

            //some basic get* accessors
            Assert.AreEqual(0, sheet.NumberOfComments);
            Assert.AreEqual(0, sheet.NumHyperlinks);
            Assert.AreEqual(0, sheet.NumMergedRegions);
            Assert.AreEqual(null, sheet.ActiveCell);
            Assert.AreEqual(true, sheet.Autobreaks);
            Assert.AreEqual(null, sheet.GetCellComment(0, 0));
            Assert.AreEqual(0, sheet.ColumnBreaks.Length);
            Assert.AreEqual(true, sheet.RowSumsBelow);
        }