Exemplo n.º 1
0
        public void TestSQLSaveStock()
        {
            DBManager sql_db = new DBManager();

            sql_db.DBConnect();

            StockPage page = new StockPage();
            DateTime  date = new DateTime(2019, 1, 3);
            String    path = page.getFileName(date);

            using (StreamReader sr = new StreamReader(@"C:\Temp\htmldwl" + path, Encoding.GetEncoding("utf-8")))
            {
                ArrayList stock_data = page.ParseHtml(conn, sr.ReadToEnd(), date);
                sql_db.StockData_Save(stock_data);
            }
        }
Exemplo n.º 2
0
        public void TestParseStockHtml()
        {
            StockPage page = new StockPage();


            DateTime date = new DateTime(2019, 1, 3);
            String   path = page.getFileName(date);

            String srcDir = @"C:\Temp\htmldwl";

            if (File.Exists(srcDir + path) == false)
            {
                //Logger.e("File " + srcDir + path + " not found!!");
                //continue;
            }

            using (StreamReader sr = new StreamReader(srcDir + path, Encoding.GetEncoding("utf-8")))
            {
                page.ParseHtml(conn, sr.ReadToEnd(), date);
            }

            Assert.Pass();
        }