public void CsvLoaderTest() { csvLoader.LoadData(new List <System.Type> { typeof(ShippingClass), typeof(Warranty) }); Assert.True(dbContext.ShippingClass.Count() == 3); Assert.True(dbContext.Warranty.Count() == 3); }
// CSV データの読み込み void LoadCSV() { starData = CsvLoader <StarData> .LoadData(starDataCSV); starMajorData = CsvLoader <StarMajorData> .LoadData(starMajorDataCSV); constellationNameData = CsvLoader <ConstellationNameData> .LoadData(constellationNameDataCSV); constellationPositionData = CsvLoader <ConstellationPositionData> .LoadData(constellationPositionDataCSV); constellationLineData = CsvLoader <ConstellationLineData> .LoadData(constellationLineDataCSV); }
private void RibbonWindow_Loaded(object sender, RoutedEventArgs e) { string dir = @"data/"; if (!Directory.Exists(dir)) { Directory.CreateDirectory(dir); } var csvLoader = new CsvLoader(); string[] files = Directory.GetFiles(dir, "*.csv"); foreach (var file in files) { string csvName = file.Split('/').Last(); string symbol = csvName.Substring(0, csvName.Length - 4); var data = csvLoader.LoadData(symbol); rawDataDict.Add(symbol, new ObservableCollection <StockInfo>(data)); stockListVM.AddStock(data); } }
private void LoadCsv() { CsvLoader loader = new CsvLoader(_context, _path); loader.LoadData(DataTypes.Types); }