Example #1
0
        public void TestParseFinancialReport()
        {
            String srcDir = @"C:\Temp\htmldwl\";

            PageFinancialReport page = new PageFinancialReport();

            String path = srcDir + page.getFileName("2379", 108, 1);

            if (File.Exists(path) == false)
            {
                String content = page.download_page(page.getPageUrl(), "2379", 108, 1);
                using (StreamWriter sw = new StreamWriter(path, false, Encoding.GetEncoding("utf-8")))
                {
                    sw.Write(content);
                    sw.Close();
                }
            }

            using (StreamReader sr = new StreamReader(path, Encoding.GetEncoding("utf-8")))
            {
                BsonDocument res = page.ParseHtml(sr.ReadToEnd());
            }

            Assert.Pass();
        }
Example #2
0
        public void TestMongoConnection()
        {
            DbMango mongo = new DbMango();

            mongo.connect();

            PageFinancialReport page = new PageFinancialReport();

            String path = @"C:\Temp\htmldwl\" + page.getFileName("2379", 108, 1);

            using (StreamReader sr = new StreamReader(path, Encoding.GetEncoding("utf-8")))
            {
                BsonDocument financial = page.ParseHtml(sr.ReadToEnd());
                mongo.FinancialReport_save(financial, "2379", 108, 1);
            }
        }