Beispiel #1
0
 public void setup()
 {
     UTestCfg.Ins.IsUTest = true;
     //if (!System.IO.Directory.Exists(Cfg.Ins.TagDB))
     //{
     //    System.IO.Directory.CreateDirectory(Cfg.Ins.TagDB);
     //}
     db = IDisposableFactory.New <SQLTagDB>(new SQLTagDB());
 }
Beispiel #2
0
        public void teardown()
        {
            IDisposableFactory.DisposeAll();
            db = null;
            while (File.Exists(CfgPath.TagDBPath_SQLite))
            {
                try
                {
                    File.Delete(CfgPath.TagDBPath_SQLite);
                    System.Threading.Thread.Sleep(100);
                    break;
                }
                catch (Exception ee)
                {
                    Logger.E(ee);
                    System.Threading.Thread.Sleep(100);
                }
            }
            //为了安全,直接硬编码,防止把真是数据删除
            string dir = @"B:\00TagExplorerBase";

            while (Directory.Exists(dir))
            {
                try
                {
                    Directory.Delete(dir, true);
                    System.Threading.Thread.Sleep(100);
                    break;
                }
                catch (Exception ee)
                {
                    Logger.E(ee);
                    System.Threading.Thread.Sleep(100);
                }
            }


            //Directory.Delete(CfgPath.DocBasePath);


            //if (System.IO.Directory.Exists(Cfg.Ins.TagDB))
            //    System.IO.Directory.Delete(Cfg.Ins.TagDB,true);
        }