Exemple #1
0
        public IList<CompareResult> Run()
        {
            var csvToDataTable = new CSVToDataTable();

            var oldTable = csvToDataTable.GetDataTable(_oldFile);
            var newTable = csvToDataTable.GetDataTable(_newFile);

            _results.Clear();

            Comparer(oldTable, newTable);

            return _results;
        }
        public string GenerateFile()
        {
            string newFullFileName = Path.GetTempFileName();

            var csvToTable = new CSVToDataTable();
            var eonDataTable = csvToTable.GetDataTable(_originalFilename);

            ModifyTable(eonDataTable);

            var tableToCsv = new DataTableToCSV();
            Stream outStream = tableToCsv.GenerateCSVStream(eonDataTable);

            var streamReader = new StreamReader(outStream);
            string entireStr = streamReader.ReadToEnd();

            File.WriteAllText(newFullFileName, entireStr);

            streamReader.Dispose();
            outStream.Dispose();

            return newFullFileName;
        }