diff --git a/Adaptation/FileHandlers/Archive/FileRead.cs b/Adaptation/FileHandlers/Archive/FileRead.cs index 0e79541..6dfdff4 100644 --- a/Adaptation/FileHandlers/Archive/FileRead.cs +++ b/Adaptation/FileHandlers/Archive/FileRead.cs @@ -115,10 +115,10 @@ public class FileRead : Shared.FileRead, IFileRead } } -#pragma warning disable IDE0060 private void MoveArchive(string reportFullPath, DateTime dateTime) -#pragma warning restore IDE0060 { + if (dateTime == DateTime.MinValue) + throw new ArgumentNullException(nameof(dateTime)); string logisticsSequence = _Logistics.Sequence.ToString(); string weekOfYear = _Calendar.GetWeekOfYear(_Logistics.DateTimeFromSequence, CalendarWeekRule.FirstDay, DayOfWeek.Sunday).ToString("00"); string weekDirectory = $"{_Logistics.DateTimeFromSequence:yyyy}_Week_{weekOfYear}{@"\"}{_Logistics.DateTimeFromSequence:yyyy-MM-dd}"; diff --git a/Adaptation/FileHandlers/OpenInsightMetrologyViewerAttachments/FileRead.cs b/Adaptation/FileHandlers/OpenInsightMetrologyViewerAttachments/FileRead.cs index 29a7698..aae6e29 100644 --- a/Adaptation/FileHandlers/OpenInsightMetrologyViewerAttachments/FileRead.cs +++ b/Adaptation/FileHandlers/OpenInsightMetrologyViewerAttachments/FileRead.cs @@ -163,10 +163,10 @@ public class FileRead : Shared.FileRead, IFileRead OpenInsightMetrologyViewer.WSRequest.PostOpenInsightMetrologyViewerAttachments(this, _Logistics, _OpenInsightMetrologyViewerAPI, descriptions, matchDirectories[0], subGroupId, headerId, headerIdDirectory); } -#pragma warning disable IDE0060 private Tuple> GetExtractResult(string reportFullPath, DateTime dateTime) -#pragma warning restore IDE0060 { + if (dateTime == DateTime.MinValue) + throw new ArgumentNullException(nameof(dateTime)); Tuple> results; Tuple pdsf = ProcessDataStandardFormat.GetLogisticsColumnsAndBody(reportFullPath); _Logistics = new Logistics(reportFullPath, pdsf.Item1); diff --git a/Adaptation/FileHandlers/pcl/ProcessData.cs b/Adaptation/FileHandlers/pcl/ProcessData.cs index 25dbc0a..41f9ce5 100644 --- a/Adaptation/FileHandlers/pcl/ProcessData.cs +++ b/Adaptation/FileHandlers/pcl/ProcessData.cs @@ -599,8 +599,8 @@ public class ProcessData : IProcessData private void Parse(IFileRead fileRead, Logistics logistics, List fileInfoCollection, ReadOnlyDictionary pages, Complete complete) { - if (!fileRead.IsEAFHosted) - fileInfoCollection.Clear(); + if (fileRead is null) + throw new ArgumentNullException(nameof(fileRead)); List sourceFiles = new(); List missingSlots = new(); Dictionary> slots = new(); @@ -610,6 +610,9 @@ public class ProcessData : IProcessData ParseLotSummary(logistics, pages, complete, headerFileName, slots); string sourcePath = Path.GetDirectoryName(logistics.ReportFullPath) ?? throw new Exception(); string sourceFileNameWithoutExtension = Path.GetFileNameWithoutExtension(logistics.ReportFullPath); + foreach (FileInfo fileInfo in fileInfoCollection) + sourceFiles.Add(fileInfo.FullName); + fileInfoCollection.Clear(); foreach (KeyValuePair keyValuePair in pages) { if (keyValuePair.Key == headerFileName)