public void TestReadCsvFile() { var customerBets = CsvObjectReader.GetCustomerBets("../../../Settled.csv"); Assert.IsNotNull(customerBets); Assert.AreEqual(50, customerBets.Count); }
/// <summary> /// Read prerequisites.csv and return list of prerequisites in this file. /// </summary> public List <CoursePrerequisite> ReadPrerequisiteList() { string inputPrerequisiteFilePath = GetFilePath(InputPrerequisiteFileName); string csvText = File.ReadAllText(inputPrerequisiteFilePath); var reader = new CsvObjectReader <CoursePrerequisite, CoursePrerequisiteMap>(); return(reader.GetList(csvText)); }
public static List <T> ReadCase(string csvFileName) { string currentAppPath = AppDomain.CurrentDomain.BaseDirectory; string filePath = Path.Combine(currentAppPath, "Cases", csvFileName); var reader = new CsvObjectReader <T, TMap>(); return(reader.GetList(filePath)); }
/// <summary> /// Loads keyed customers data from the source file. /// </summary> protected virtual void LoadKeyedCustomersData() { List <CustomerBet> list = CsvObjectReader.GetCustomerBets(DataSourceFilePath); KeyedCustomersData = list.OrderBy(i => i.CustomerId).GroupBy(i => i.CustomerId).ToDictionary(i => i.Key, i => i.ToList()); }