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)); }
public void GetBuildVersion() { AppSettings appstgs = new AppSettings(); string directVersion = appstgs.ApplicationVersion; SQLTransporter sqlTrns = new SQLTransporter("MyTestServer"); Assert.AreEqual(directVersion, sqlTrns.GetBuildVersion()); }
public void GetFreeDiskSpace() { long knownFreeSpace = 136883; long fetchedFreeSpace = 0; SQLTransporter sqlTrns = new SQLTransporter("MyTestServer"); fetchedFreeSpace = sqlTrns.GetFreeDiskSpace(); Assert.IsTrue(knownFreeSpace < fetchedFreeSpace); }
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); }
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)); }