Exemplo n.º 1
0
        public void CreateMySQLTablesTest()
        {
            service = new StockTradeDetailResolver();
            var files = service.GetFiles();

            service.CreateMysqlTables();
        }
Exemplo n.º 2
0
        public void SaveListTest()
        {
            DateTime start = DateTime.Now;
            DateTime end   = DateTime.Now;
            TimeSpan span  = end - start;

            service = new StockTradeDetailResolver();
            var files = service.GetFiles();

            end   = DateTime.Now;
            span  = end - start;
            start = DateTime.Now;
            Debug.WriteLine("GetFiles: " + span);

            service.CreateMysqlTables();

            end   = DateTime.Now;
            span  = end - start;
            start = DateTime.Now;
            Debug.WriteLine("CreateMysqlTables: " + span);

            foreach (var file in files)
            {
                var lst = service.GetList(file);
                end   = DateTime.Now;
                span  = end - start;
                start = DateTime.Now;
                Debug.WriteLine("File name: " + Path.GetFileNameWithoutExtension(file));
                Debug.WriteLine("GetList: " + span);

                service.BulkInsert(file, Encoding.Default);

                end   = DateTime.Now;
                span  = end - start;
                start = DateTime.Now;
                Debug.WriteLine("Save: " + span);
            }
        }