public DataTable ConsumeFile(UploadExcelFileModel uploadFile) { var memoryStream = new MemoryStream(); uploadFile.File.InputStream.CopyTo(memoryStream); return(ExcelParser.ExtractExcelSheetValues(memoryStream, ServiceOfferingSheetName)); }
public void GivenANullWorkSheetName_WhenIParse_ThenADataTableWillBeReturned() { var filePath = UploadFileTemplatePath + "NullStartEndDateAndNotesCol.xlsx"; var destinationPath = CopyTestFile(filePath); using (FileStream fs = File.Open(destinationPath, FileMode.Open)) { var dataTable = ExcelParser.ExtractExcelSheetValues(fs, null) as DataTable; Assert.IsNotNull(dataTable); Assert.IsTrue(dataTable.Rows.Count > 0); } DestroyTestFile(destinationPath); }