private void OnChangedFile(string fileName) { try { var timeEntries = _entryRowReader.Read(fileName, new TimeEntryRowFilter { SkipEmptyLines = true }); _processor.Process(timeEntries); Logger.InfoFormat("Successfully processed '{0}'", fileName); } catch (Exception e) { Logger.ErrorFormat(e, "Error occured while processing '{0}'", fileName); } }
public void it_throws_a_file_not_found_exception() { var file = Path.GetFullPath(Path.Combine(Directory.GetCurrentDirectory(), "Files", "Unexisting.xlsm")); Should.Throw <FileNotFoundException>(() => _timeEntryRowReader.Read(file, _rowFilter)); }
public void it_skips_heading_lines() { var timeEntries = _timeEntryRowReader.Read(_timeEntryExcelFile, _rowFilter); timeEntries.ShouldNotContain(timeEntry => timeEntry.Date == DateTime.MinValue); }