public void ExcelDataReaderOpenClose() { using (ExcelFileReaderInterop test = new ExcelFileReaderInterop()) { test.Open(m_ValidSetting, CancellationToken.None, true); Assert.IsFalse(test.IsClosed); test.Close(); Assert.IsTrue(test.IsClosed); } }
public void OpenColoseWithRange() { ExcelFile file = new ExcelFile(); file.FileName = System.IO.Path.Combine(m_ApplicationDirectory, "DateTimeCombineExcel.xlsx"); file.SheetName = "Combinations"; file.SheetRange = "A12:D24"; file.ShowProgress = false; using (ExcelFileReaderInterop reader = new ExcelFileReaderInterop()) { reader.Open(file, System.Threading.CancellationToken.None, true); Assert.IsFalse(reader.IsClosed); reader.Close(); Assert.IsTrue(reader.IsClosed); } }
public void OpenwithoutRangeProcess() { ExcelFile file = new ExcelFile(); file.FileName = System.IO.Path.Combine(m_ApplicationDirectory, "DateTimeCombineExcel.xlsx"); file.SheetName = "Combinations"; file.ShowProgress = true; file.HasFieldHeader = true; using (ExcelFileReaderInterop reader = new ExcelFileReaderInterop()) { using (FormProcessDisplay disp = new FormProcessDisplay("Test", null, null)) { reader.ProcessDisplay = disp; reader.Open(file, System.Threading.CancellationToken.None, true); Assert.IsFalse(reader.IsClosed); reader.Close(); Assert.IsTrue(reader.IsClosed); } } }