public void FindMethodOK() { // Create New Instance of class clsStaff staffMember = new clsStaff(); // Var to store result of method Boolean found = false; // Employee no to search for int employeeNo = 1; // Use the find method found = staffMember.find(employeeNo); Assert.IsTrue(found); }
public void TestFirstNameFound() { // Create New instance of staff clsStaff staffMember = new clsStaff(); // Var to store result of method Boolean found = false; // Var to keep track if data is right Boolean OK = true; // salary to search for String firstName = "Joe"; // Use the find method found = staffMember.find(1); // Check the pulled data if (staffMember.first_name != firstName) { OK = false; } Assert.IsTrue(OK); }
public void TestSalaryFound() { // Create New instance of staff clsStaff staffMember = new clsStaff(); // Var to store result of method Boolean found = false; // Var to keep track if data is right Boolean OK = true; // salary to search for Int32 salary = 15000; // Use the find method found = staffMember.find(1); // Check the pulled data if (staffMember.salary != salary) { OK = false; } Assert.IsTrue(OK); }
public void TestEmployeeNoFound() { // Create New instance of staff clsStaff staffMember = new clsStaff(); // Var to store result of method Boolean found = false; // Var to keep track if data is right Boolean OK = true; // Employee no to search for Int32 employeeNo = 1; // Use the find method found = staffMember.find(employeeNo); // Check the pulled data if (staffMember.EmployeeNo != 1) { OK = false; } Assert.IsTrue(OK); }
public void TestCreatedAtFound() { // Create New instance of staff clsStaff staffMember = new clsStaff(); // Var to store result of method Boolean found = false; // Var to keep track if data is right Boolean OK = true; // salary to search for DateTime createdAt = Convert.ToDateTime("01/01/2020"); // Use the find method found = staffMember.find(1); // Check the pulled data if (staffMember.created_at != createdAt) { OK = false; } Assert.IsTrue(OK); }
protected void FindBtn_On_click(object sender, EventArgs e) { clsStaff staff = new clsStaff(); Int32 EmployeeID; Boolean Found = false; EmployeeID = Convert.ToInt32(EmployeeIDBox.Text); Found = staff.find(EmployeeID); if (Found) { FirstNameBox.Text = staff.first_name; LastNameBox.Text = staff.last_name; SalaryBox.Text = Convert.ToString(staff.salary); DateAddedBox.Text = Convert.ToString(staff.created_at); } }