public bool AdminUpdateAdmins(DataSet ds) { ctrAdminObj = new CtrAdmin(); Console.WriteLine(); Console.WriteLine("AdminUpdateAdmins() " + GetExecutionThreadTime()); return(ctrAdminObj.UpdateAdmins(ds)); }
public DataSet AdminGetTableData(string selectedTable) { ctrAdminObj = new CtrAdmin(); Console.WriteLine(); Console.WriteLine("AdminGetTableData() " + GetExecutionThreadTime()); Console.WriteLine("Table: " + selectedTable); return(ctrAdminObj.GetTableData(selectedTable)); }
public void AdminUpdateAdmins() { CtrAdmin ctrAdminObj = new CtrAdmin(); DataSet ds = GetAdminDataSet("admin2", "admin2"); bool actual = ctrAdminObj.UpdateAdmins(ds); bool expected = true; Assert.AreEqual(expected, actual); }
public void AdminLogin() { CtrAdmin ctrAdminObj = new CtrAdmin(); DataSet ds = GetAdminDataSet("admin3", "admin3"); ctrAdminObj.UpdateAdmins(ds); int expected = 1; int actual = ctrAdminObj.Login("admin3", "admin3"); Assert.AreEqual(expected, actual); }
public void AdminAddApplication() { CtrAdmin ctrAdminObj = new CtrAdmin(); DataSet ds = ctrAdminObj.GetTableData("Applications"); DataRow dr = ds.Tables[0].NewRow(); dr["StudentEmail"] = "*****@*****.**"; dr["FlatId"] = 75; ds.Tables[0].Rows.Add(dr); ctrAdminObj.UpdateApplications(ds); }
public void AdminUpdateFlats() { CtrAdmin ctrAdminObj = new CtrAdmin(); DataSet ds = ctrAdminObj.GetTableData("Flats"); ds.Tables[0].Rows[0]["Description"] = "This is changed descrition..."; bool actual = ctrAdminObj.UpdateFlats(ds); bool expected = true; Assert.AreEqual(expected, actual); }
private DataSet GetAdminDataSet(string username, string password) { CtrAdmin ctrAdminObj = new CtrAdmin(); DataSet ds = ctrAdminObj.GetTableData("Admins"); DataRow dr = ds.Tables[0].NewRow(); dr["Username"] = username; dr["Password"] = password; dr["Salt"] = "None"; ds.Tables[0].Rows.Add(dr); return(ds); }
//ADMIN public int AdminLogin(string username, string password) { ctrAdminObj = new CtrAdmin(); //lock (LockObject) //{ Console.WriteLine(); //Console.WriteLine("START THREAD ID: " + Thread.CurrentThread.ManagedThreadId.ToString()); Console.WriteLine("AdminLogin() " + GetExecutionThreadTime()); //Thread.Sleep(3000); return(ctrAdminObj.Login(username, password)); //} }
public void AdminUpdateLandlords() { CtrAdmin ctrAdminObj = new CtrAdmin(); DataSet ds = ctrAdminObj.GetTableData("Landlords"); DataRow dr = ds.Tables[0].NewRow(); dr = AddLandlordRow(dr); ds.Tables[0].Rows.Add(dr); bool actual = ctrAdminObj.UpdateLandlords(ds); bool expected = true; Assert.AreEqual(expected, actual); }