Ejemplo n.º 1
0
        private static async Task CreatesResultsFile(string saveFileName, string comparisonTempFile, string rowOrphans1TempFile, string rowOrphans2TempFile, List <string> columnOrphans1, List <string> columnOrphans2)
        {
            // Merge output results
            using (var resultsWriter = new StreamWriter(saveFileName))
            {
                // Differences
                await CsvWriter.WriteRowToWriter(new[] { "Differences: " }, resultsWriter);

                await CsvWriter.CopyFileToWriter(comparisonTempFile, resultsWriter);

                // Extra Rows 1
                await CsvWriter.WriteRowToWriter(null, resultsWriter);

                await CsvWriter.WriteRowToWriter(new[] { "File 1 Extra Rows:" }, resultsWriter);

                await CsvWriter.CopyFileToWriter(rowOrphans1TempFile, resultsWriter);

                // Extra Rows 2
                await CsvWriter.WriteRowToWriter(null, resultsWriter);

                await CsvWriter.WriteRowToWriter(new[] { "File 2 Extra Rows:" }, resultsWriter);

                await CsvWriter.CopyFileToWriter(rowOrphans2TempFile, resultsWriter);

                // Extra Columns 1
                await CsvWriter.WriteRowToWriter(null, resultsWriter);

                columnOrphans1.Insert(0, "File 1 Extra Columns:");
                await CsvWriter.WriteRowToWriter(columnOrphans1, resultsWriter);

                // Extra Columns 2
                await CsvWriter.WriteRowToWriter(null, resultsWriter);

                columnOrphans2.Insert(0, "File 2 Extra Columns:");
                await CsvWriter.WriteRowToWriter(columnOrphans2, resultsWriter);
            }
        }