public void Test_Previous_Alarms_Show() { Do_Pretesting_Login(); // Log in foreach (DataGridViewRow row in _alarm.AlarmsList.Rows) { Console.WriteLine("The value is: " + row.Cells[0].Value); isThere = _mysql.DataExists("NEWTimedRequests", "TimeToComplete = '02:34:00'"); } Assert.AreEqual(isThere, true); }
public void Resident_Can_Add_New_Request() { _form1 = new Form1(); _mysql = new Mysql_Connect(); _home = new HomePage(_form1, _mysql); _food = new Order_Food(_home, _mysql, _form1, null, "breakfast"); // The type of meal (Lunch, breakfast, etc). For the purpose of this unit test // a new mealtype and mealname called 'test' was created. _food._mealType = "test"; _food._HotOrCold = "hot"; _food._chosenMealName = "test"; _form1.Username_Textbox.Text = "resident"; _form1.Password_Textbox.Text = "resident"; _form1.UserNameProperty = "resident"; _form1.PasswordProperty = "resident"; // Simulate the user clicking on login, to ensure the Login_Click method works _form1.Login_Click(new object(), EventArgs.Empty); // Simulate the user clicking on submit, to ensure the Submit_Clicked method works _food.Submit_Clicked(new object(), new EventArgs()); // Check to see if the order is now in the database. Assert.IsTrue(mysql_handler.DataExists( "NEWFoodRequests", "UID = '5' AND MealType = 'test' AND MealName = 'test';")); // Now delete the entry, so that this test can be re-tested again at a later time mysql_handler.Delete("DELETE FROM NEWFoodRequests WHERE UID = 5 AND MealType = 'test' AND MealName = 'test'"); }
public void Test_Visitors_Show() { _form1 = new Form1(); _mysql = new Mysql_Connect(); _list = new List_Of_Requests(_form1, _mysql); _visitor = new Visitor_Signin(_list, _mysql, _form1); bool exists = _mysql.DataExists("NEWVisitorIn", "First_Name = 'dec0004'"); Assert.IsTrue(exists); }