예제 #1
0
        public void FormatSqlValue()
        {
            string inputString    = "I'left'my'secret'decoder'ring'at'home";
            string expectedString = "I''left''my''secret''decoder''ring''at''home";

            SQLTransporter sqlTrns = new SQLTransporter("MyTestServer");

            Assert.AreEqual(expectedString, sqlTrns.FormatSqlValue(inputString));
        }
예제 #2
0
        public void GetBuildVersion()
        {
            AppSettings appstgs       = new AppSettings();
            string      directVersion = appstgs.ApplicationVersion;

            SQLTransporter sqlTrns = new SQLTransporter("MyTestServer");

            Assert.AreEqual(directVersion, sqlTrns.GetBuildVersion());
        }
예제 #3
0
        public void GetFreeDiskSpace()
        {
            long           knownFreeSpace   = 136883;
            long           fetchedFreeSpace = 0;
            SQLTransporter sqlTrns          = new SQLTransporter("MyTestServer");

            fetchedFreeSpace = sqlTrns.GetFreeDiskSpace();

            Assert.IsTrue(knownFreeSpace < fetchedFreeSpace);
        }
예제 #4
0
        public void ValidateDateTimeStringValue()
        {
            DateTime       timeNow = DateTime.Now;
            SQLTransporter sqlTrns = new SQLTransporter("MyTestServer");
            DateTime       retDT;

            DateTime.TryParse(sqlTrns.ValidateDateTimeStringValue(timeNow.ToString("o")), out retDT);

            Assert.AreEqual(timeNow, retDT);
        }
예제 #5
0
        public void ManageLogFile_NoLogFileExistCreate()
        {
            string logFileName       = "AWARE_SQL_Transporter.log";
            string theCurrentLogFile = Directory.GetCurrentDirectory() + "\\" + logFileName;

            if (true == File.Exists(logFileName))
            {
                File.Delete(logFileName);
            }

            SQLTransporter sqlTrns = new SQLTransporter("MyTestServer");

            sqlTrns.ManageLogFiles();
            Assert.IsTrue(File.Exists(logFileName));
        }