public void SetDBInfoTest()
        {
            DataBaseOperAt.SetDBInfo("192.168.2.18", 3306, "alarmsystem", "root", "mypassword", Enum_DataBase.MySQL);
            string str = DBHelpMySql.connectionString;

            Assert.AreEqual("1", str);
        }
예제 #2
0
        public void VideoInfo_DataRowToVideoInfoTest()
        {
            StringBuilder sbExecSQL = new StringBuilder();

            sbExecSQL.Append("SELECT TOP 1 * FROM T_VideoTable ");
            sbExecSQL.Append("WHERE HostNumber ='9998' ");
            DataTable        dtResult = DataBaseOperAt.QuerySQL(sbExecSQL.ToString()).Tables[0];
            VideoInfo        v        = SK3000DataConvert.VideoInfo_DataRowToVideoInfo(dtResult.Rows[0]).DeepCloneObject();
            List <VideoInfo> lst      = new List <VideoInfo>();

            lst.Add(v);
            List <VideoInfo> lstV = lst.DeepCloneList().ToList();

            Assert.AreEqual(v.VideoType, Enum_VideoType.XMaiVideo);
        }
예제 #3
0
        public void ExecSQLTest1()
        {
            StringBuilder sbExecSQL = new StringBuilder();
            int           intIndex  = 0;
            int           intResult = 0;

            while (intIndex < 100000)
            {
                sbExecSQL = new StringBuilder();
                sbExecSQL.Append("INSERT T_EventRecord(Cen_Code,Dev_ID,Ev_Content) Value ");
                for (int i = 0; i < 10000; i++)
                {
                    sbExecSQL.Append("('05950002','00000000011000','测试数据" + intIndex + "'),");
                    intIndex++;
                }
                sbExecSQL.Length = sbExecSQL.Length - 1;
                intResult        = DataBaseOperAt.ExecSQL(sbExecSQL.ToString());
            }
            Assert.AreEqual(intResult, 1);
        }
예제 #4
0
        public void ExecSQLTest()
        {
            StringBuilder sbExecSQL = new StringBuilder();
            int           intIndex  = 0;
            int           intResult = 0;

            while (intIndex < 1000000)
            {
                sbExecSQL = new StringBuilder();
                sbExecSQL.Append("INSERT T_Device(Cen_Code,Dev_UniqueCode) Value ");
                for (int i = 0; i < 100000; i++)
                {
                    sbExecSQL.Append("('05950002','" + intIndex.ToString().PadLeft(14, '0') + "'),");
                    intIndex++;
                }
                sbExecSQL.Length = sbExecSQL.Length - 1;
                intResult        = DataBaseOperAt.ExecSQL(sbExecSQL.ToString());
            }
            Assert.AreEqual(intResult, 1);
        }
예제 #5
0
 public SK3000DataConvertTests()
 {
     //DataBaseOperAt.SetDBInfo("121.41.87.203", 1433, "报警点基本信息", "sa", "security999", Enum_DataBase.MSSQLServer);
     //DataBaseOperAt.SetDBInfo("192.168.5.15", 43399, "报警点基本信息", "sa", "security999", Enum_DataBase.MSSQLServer);
     DataBaseOperAt.SetDBInfo("192.168.2.19", 1433, "报警点基本信息1", "sa", "security999", Enum_DataBase.MSSQLServer);
 }
예제 #6
0
 public DataBaseOperAtTests()
 {
     DataBaseOperAt.SetDBInfo("192.168.2.19 ", 3306, "skl9000test3", "root", "security999", Enum_DataBase.MySQL);
 }