예제 #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);
 }
예제 #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());
 }
예제 #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);
        }
예제 #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);
        }
예제 #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());
        }
예제 #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);
        }
예제 #7
0
파일: ResultSet.cs 프로젝트: OlekNg/AHMED
 private void LoadIterationsData()
 {
     IterationData = passes.Select(passFolder =>
     {
         var csv = new CsvImport<IterationData>();
         csv.Import(Path.Combine(passFolder, "iterations.csv"));
         return csv.Objects;
     }).ToList();
 }