public void ClearTableTest() { DBConnectionHelper.Init(_ProjectPath.projectPath + @"\DB\Database_Test.mdb"); string table = DBConnectionHelper._tableBuddy; DBConnectionHelper.ClearTable(table); Thread.Sleep(1000); List <Record> list = DBConnectionHelper.ReadUserRecords(); int before = list.Count; if (before == 0) { DBConnectionHelper.ExecuteNonQuery(DBConnectionHelper.MakeSQLInsertQuery(DBConnectionHelper._tableUser, new String[] { DBConnectionHelper._columnName, DBConnectionHelper._columPasword, DBConnectionHelper._columnEmail, DBConnectionHelper._columnGuid }, new String[] { "Username", "Password", "*****@*****.**", Guid.NewGuid().ToString() })); Thread.Sleep(1000); before = (list = DBConnectionHelper.ReadUserRecords()).Count; } Assert.IsTrue(before > 0, "No entries in table"); table = DBConnectionHelper._tableUser; DBConnectionHelper.ClearTable(table); Thread.Sleep(1000); int after = (list = DBConnectionHelper.ReadUserRecords()).Count; Assert.AreEqual(0, after); }
public void Setup() { /*ConfigurationManager.OpenExeConfiguration(_ProjectPath.projectPath + "\\Web.config"); * Thread.Sleep(1000); * ConfigurationManager.RefreshSection("appSettings"); * foreach (String item in ConfigurationManager.AppSettings.AllKeys) { * String value = ConfigurationManager.AppSettings[item]; * } */ DBConnectionHelper.Init(_ProjectPath.projectPath + @"\DB\Database_Test.mdb"); DBConnectionHelper._columnBuddyBuddy = "CUser"; DBConnectionHelper._columnBuddyUser = "******"; DBConnectionHelper._columnEmail = "CEmail"; DBConnectionHelper._columnGuid = "CGuid"; DBConnectionHelper._columnName = "CName"; DBConnectionHelper._columPasword = "CPassword"; DBConnectionHelper._tableBuddy = "TBuddies"; DBConnectionHelper._tableUser = "******"; DBConnectionHelper.ClearTable(DBConnectionHelper._tableBuddy); DBConnectionHelper.ClearTable(DBConnectionHelper._tableUser); }
public void Teardown() { DBConnectionHelper.ClearTable(DBConnectionHelper._tableBuddy); DBConnectionHelper.ClearTable(DBConnectionHelper._tableUser); }
public void Setup() { DBConnectionHelper.Init(_ProjectPath.projectPath + @"\DB\Database_Test.mdb"); DBConnectionHelper.ClearTable(DBConnectionHelper._tableBuddy); DBConnectionHelper.ClearTable(DBConnectionHelper._tableUser); }