Beispiel #1
0
 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);
 }
Beispiel #2
0
 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());
 }
Beispiel #3
0
        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);
        }
Beispiel #4
0
        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);
        }
Beispiel #5
0
        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());
        }
Beispiel #6
0
        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);
        }
Beispiel #7
0
 private void LoadIterationsData()
 {
     IterationData = passes.Select(passFolder =>
     {
         var csv = new CsvImport<IterationData>();
         csv.Import(Path.Combine(passFolder, "iterations.csv"));
         return csv.Objects;
     }).ToList();
 }