public void ShouldSaveFileWithTheSummary() { var summaryResult = new SummaryResult { AmoutClients = 1, AmoutSalesman = 1, FileName = "Test.done.dat", IdExpensiveSale = "1a", WorstSalesman = "fulano" }; _fileManagement.SaveFile(summaryResult); var files = Directory.GetFiles(PathConfigurations.RootPathOut, "Test.done.dat", SearchOption.TopDirectoryOnly).ToList(); files.Any().Should().BeTrue(); files.ForEach(File.Delete); }
public void ProcessFiles() { try { foreach (var file in _fileManagement.Scanner()) { var fileProcessing = _fileManagement.MoveForProcessing(file); var summaryResult = _fileProcessor.SummarizeFile(fileProcessing); if (summaryResult != null) { _fileManagement.SaveFile(summaryResult); } } } catch (Exception ex) { _logger.LogError(ex, "Process file error!"); } }