Ejemplo n.º 1
0
        public void Should_output_data()
        {
            formatter.WriteDataToSheet(workBook.GetSheetAt(0), sampleData);

            Row row = Helper.GetRowData(workBook, 0);

            Helper.CompareCellData(row, sampleData[0]);
        }
        public void Should_be_able_to_export_plain_text_from_formatted_data()
        {
            target.WriteDataToSheet(workBook.GetSheetAt(0), sampleData);

            Row row = Helper.GetRowData(workBook, 0);

            Helper.CompareCellData(row, sampleData[0].Cast <Cell>().ToList());
        }
Ejemplo n.º 3
0
        public void WriteDataToExport(IEnumerable <IEnumerable <Cell> > rowData, CellFormatter formatter, string sheetName)
        {
            if (currentSheet == null)
            {
                currentSheet = workBook.CreateSheet(sheetName);
            }

            formatter.WriteDataToSheet(currentSheet, rowData);
        }
Ejemplo n.º 4
0
        public void Should_be_able_to_pass_data_to_be_written_to_workbook()
        {
            ExcelExport target = new ExcelExport();
            Workbook    book   = Helper.CreateWorkBookWithSheet();

            List <List <Cell> > cells = new List <List <Cell> >
            {
                new List <Cell>
                {
                    new Cell {
                        Value = "123"
                    }
                }
            };

            CellFormatter formatter = Substitute.For <CellFormatter>();

            formatter.WriteDataToSheet(book.GetSheetAt(0), cells);
            formatter.Received().WriteDataToSheet(book.GetSheetAt(0), cells);
        }