Beispiel #1
0
        public void TestGetCharts()
        {
            XSSFWorkbook wb = XSSFTestDataSamples.OpenSampleWorkbook("chart_sheet.xlsx");

            XSSFSheet      ns = (XSSFSheet)wb.GetSheetAt(0);
            XSSFChartSheet cs = (XSSFChartSheet)wb.GetSheetAt(2);

            Assert.AreEqual(0, (ns.CreateDrawingPatriarch() as XSSFDrawing).GetCharts().Count);
            Assert.AreEqual(1, (cs.CreateDrawingPatriarch() as XSSFDrawing).GetCharts().Count);

            XSSFChart chart = (cs.CreateDrawingPatriarch() as XSSFDrawing).GetCharts()[0];

            Assert.AreEqual(null, chart.Title);
        }
Beispiel #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);
        }