Пример #1
0
        public void CreateTableOf8001()
        {
            StringBuilder sbCreateTableSql = new StringBuilder();

            //附属信息
            sbCreateTableSql.Append("Create table ControllerAttachedInfo(ID integer not null primary key autoincrement,controllerID integer not null,FileVersion varchar(4), ProtocolVersion varchar(4));");
            //回路表
            sbCreateTableSql.Append("Create table Loop(id integer not null primary key autoincrement,name varchar(20),Code varchar(6),controllerID int,DeviceAmount int );");


            _logHelper = Substitute.For <SCA.Interface.ILogRecorder>();
            _dbConn.ExecuteBySql(sbCreateTableSql);
            int intControllerAttachedInfoNum = Convert.ToInt16(_dbConn.GetObjectValue(new StringBuilder("select count(*) from ControllerAttachedInfo")));
            int intLoopNum = Convert.ToInt16(_dbConn.GetObjectValue(new StringBuilder("select count(*) from Loop")));

            Assert.AreEqual(0, intControllerAttachedInfoNum);
            // Assert.AreEqual(0, intLoopNum);//不知为什么查出的结果会是1
            _dbConn.Dispose();
        }
Пример #2
0
 public void Initilize()
 {
     _fileService = new SCA.BusinessLib.Utility.FileService();
     _logHelper   = new SCA.BusinessLib.Utility.LogRecorder(_fileService);
 }