Exemplo n.º 1
0
 private void ProcessColumnHeaderRow(ProcessorRequest request, File file, List <ValidationMessage> messages, StreamReader reader, IEnumerable <string> columnHeaders)
 {
     reader.ReadLine();
     request.RequiredColumn.Validate(messages, file, columnHeaders);
     request.UnexpectedColumn.Validate(messages, file, columnHeaders);
 }
Exemplo n.º 2
0
        private void ProcessFile(List <ValidationMessage> messages, IEnumerable <string> filesInDirectory, ProcessorRequest request, File file)
        {
            if (!filesInDirectory.Contains(file.Name))
            {
                return;
            }

            using (var reader = new StreamReader(file.Name))
            {
                var line = reader.ReadLine();
                if (!request.FileChecksum.Read(messages, file.Name, line))
                {
                    return;
                }

                var columnHeaders = request.DelimiterParser.Get(line);
                ProcessColumnHeaderRow(request, file, messages, reader, columnHeaders);

                var i = ProcessBody(request, file, messages, reader, columnHeaders);

                request.FileChecksum.Validate(messages, file.Name, i);
            }
        }