Esempio n. 1
0
        public DataSet AdminGetTableData(string selectedTable)
        {
            ctrAdminObj = new CtrAdmin();

            Console.WriteLine();
            Console.WriteLine("AdminGetTableData() " + GetExecutionThreadTime());
            Console.WriteLine("Table: " + selectedTable);

            return ctrAdminObj.GetTableData(selectedTable);
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
        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);
        }
Esempio n. 5
0
        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;
        }