using System; using Npoi.Core.SS.UserModel; using Npoi.Core.SS; namespace TestCases.SS { /// /// Encapsulates a provider of test data for common HSSF / XSSF tests. /// public interface ITestDataProvider { /// /// Override to provide HSSF / XSSF specific way for re-serialising a workbook /// /// the workbook to re-serialize. /// the re-serialized workbook IWorkbook WriteOutAndReadBack(IWorkbook wb); /// /// Override to provide way of loading HSSF / XSSF sample workbooks /// /// the file name to load. /// an instance of Workbook loaded from the supplied file name IWorkbook OpenSampleWorkbook(String sampleFileName); /// /// Override to provide way of creating HSSF / XSSF workbooks /// /// an instance of Workbook IWorkbook CreateWorkbook(); /// ///Opens a sample file from the standard HSSF test data directory /// /// Name of the file. /// an open InputStream for the specified sample file byte[] GetTestDataFileContent(String fileName); SpreadsheetVersion GetSpreadsheetVersion(); string StandardFileNameExtension { get; } /** * Creates the corresponding {@link FormulaEvaluator} for the * type of Workbook handled by this Provider. * * @param wb The workbook to base the formula evaluator on. * @return A new instance of a matching type of formula evaluator. */ IFormulaEvaluator CreateFormulaEvaluator(IWorkbook wb); } }