public void BaguetteRightQuantity() { string str = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "CsvFolder\\"); DirectoryInfo import = Directory.CreateDirectory(str); try { CsvImport csv = new CsvImport(import); csv.Import<ProductMap, ProductModel, MyContext>("products-*.csv"); } catch { } MyContext db = new MyContext(); Assert.AreEqual(20, db.Products.Where(x => x.Reference == "BAGUETTE").First().Quantity); }
public void CountProduct() { string str = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "CsvFolder\\"); DirectoryInfo import = Directory.CreateDirectory(str); try { CsvImport csv = new CsvImport(import); csv.Import<ProductMap, ProductModel, MyContext>("products-*.csv"); } catch { } MyContext db = new MyContext(); Assert.AreEqual(2, db.Products.Count()); }
public void BasicTest() { string str = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "CsvFolder\\"); DirectoryInfo import = Directory.CreateDirectory(str); try { CsvImport csv = new CsvImport(import); csv.Import<ProductMap, ProductModel, MyContext>("products-*.csv"); } catch { } MyContext db = new MyContext(); Product p = db.Products.Where(x => x.Reference == "FROMAGE").FirstOrDefault(); Assert.AreNotEqual(null, p); }
public void BaguetteRightQuantity() { string str = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "CsvFolder\\"); DirectoryInfo import = Directory.CreateDirectory(str); try { CsvImport csv = new CsvImport(import); csv.Import <ProductMap, ProductModel, MyContext>("products-*.csv"); } catch { } MyContext db = new MyContext(); Assert.AreEqual(20, db.Products.Where(x => x.Reference == "BAGUETTE").First().Quantity); }
public void CountProduct() { string str = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "CsvFolder\\"); DirectoryInfo import = Directory.CreateDirectory(str); try { CsvImport csv = new CsvImport(import); csv.Import <ProductMap, ProductModel, MyContext>("products-*.csv"); } catch { } MyContext db = new MyContext(); Assert.AreEqual(2, db.Products.Count()); }
public void BasicTest() { string str = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "CsvFolder\\"); DirectoryInfo import = Directory.CreateDirectory(str); try { CsvImport csv = new CsvImport(import); csv.Import <ProductMap, ProductModel, MyContext>("products-*.csv"); } catch { } MyContext db = new MyContext(); Product p = db.Products.Where(x => x.Reference == "FROMAGE").FirstOrDefault(); Assert.AreNotEqual(null, p); }
private void LoadIterationsData() { IterationData = passes.Select(passFolder => { var csv = new CsvImport<IterationData>(); csv.Import(Path.Combine(passFolder, "iterations.csv")); return csv.Objects; }).ToList(); }