public ParallelQuery <CsvMappingResult <Student> > ParseStudent() { CSVStudentMapper csvMapper = new CSVStudentMapper(CSVFileHeaders); CsvParser <Student> csvParser = new CsvParser <Student>(this.csvParseOptions, csvMapper); return(csvParser .ReadFromFile(CSVInputFile, Encoding.UTF8)); }
public void csvParser_StudentParserOnMERGED_ReturnStudenttInstance() { var headers = File.ReadLines(testLargeCSVFile).First().Split(',').ToList(); CsvParserOptions csvParserOptions = new CsvParserOptions(true, ','); CSVStudentMapper csvMapper = new CSVStudentMapper(headers); CsvParser <Student> csvParser = new CsvParser <Student>(csvParserOptions, csvMapper); var result = csvParser .ReadFromFile(testLargeCSVFile, Encoding.UTF8) .ToList(); Assert.AreEqual(7175, result.Count); var errs = result.All(x => !x.IsValid); Assert.IsTrue(result.All(x => x.IsValid)); }