public string[] ReadCSV()
        {
            //The csv employee-payroll-data.csv file gets transported into List<PayRecord>
            List <PayRecord> payRecord = CsvImporter.ImportPayRecords(importFileLocation);

            //A name of the file that will be used for outputs is created
            //The file name looks like this: {637381283525934083}-records.csv
            //The big number in the middle 637381283525934083 is a unique number that counts the current number of ticks since 1st Jan 1970.
            string filename = outputFileLocation + ("{" + DateTime.Now.Ticks.ToString() + "}-records.csv");;

            string[] output = PayRecordWriter.Write(filename, payRecord, true);

            return(output);
        }
Exemplo n.º 2
0
        public void TestExport()
        {
            string erelativePath = Path.Combine(
                AppDomain.CurrentDomain.BaseDirectory,
                "..",
                "..",
                "..",
                "Export"
                );

            string exportPath = Path.Combine(erelativePath, "Testresults.csv");

            PayRecordWriter.Write(exportPath, _records, true);

            Assert.IsTrue(File.Exists(exportPath));
        }