Exemplo n.º 1
0
        public void TestStartBlock_EndBlock_Write()
        {
            HSSFWorkbook wb = HSSFTestDataSamples.OpenSampleWorkbook("chartdemo.xls");

            Record[] sheetRecs = RecordInspector.GetRecords(wb.GetSheetAt(0), 0);

            RecordStream rs = new RecordStream(sheetRecs.ToList(), 0);

            rs.FindChartSubStream();
            int pos = rs.GetCountRead();

            ChartSheetAggregate csAgg = new ChartSheetAggregate(rs, null);

            RecordInspector.RecordCollector rv = new RecordInspector.RecordCollector();
            csAgg.VisitContainedRecords(rv);
            Record[] outRecs = rv.Records;
            for (int i = 0; i < outRecs.Length; i++)
            {
                Assert.AreEqual(sheetRecs[pos + i].GetType(), outRecs[i].GetType());
            }
        }