Ejemplo n.º 1
0
        public void CountProduct()
        {
            try
            {
                CsvImport.Import<ProductMap, ProductModel, MyContext>("products-*.csv", Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\CsvFolder\\");

            }
            catch { }
            MyContext db = new MyContext();
            Assert.AreEqual(2, db.Products.Count());
        }
Ejemplo n.º 2
0
        public void BaguetteRightQuantity()
        {
            try
            {
                CsvImport.Import<ProductMap, ProductModel, MyContext>("products-*.csv", Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\CsvFolder\\");

            }
            catch { }
            MyContext db = new MyContext();
            Assert.AreEqual(20, db.Products.Where(x=>x.Reference == "BAGUETTE").First().Quantity);
        }
Ejemplo n.º 3
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());
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 5
0
        public void BasicTest()
        {
            try
            {
                CsvImport.Import<ProductMap, ProductModel, MyContext>("products-*.csv", Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\CsvFolder\\");

            }
            catch { }
            MyContext db = new MyContext();

            Product p = db.Products.Where(x => x.Reference == "FROMAGE").FirstOrDefault();
            Assert.AreNotEqual(null, p);
        }
Ejemplo n.º 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);
        }