public void FindMethodOK() { //creates an instance clsDepartment AnDepartment = new clsDepartment(); //boolean variable to store the result Boolean Found = false; //test data int Dep_ID = 1; //invoke the method Found = AnDepartment.Find(Dep_ID); //test to see that the result is correct Assert.IsTrue(Found); }
protected void btnFind_Click(object sender, EventArgs e) { clsDepartment ADepartment = new clsDepartment(); Int32 dep_ID; Boolean Found = false; dep_ID = Convert.ToInt32(txtdep_ID.Text); Found = ADepartment.Find(dep_ID); if (Found == true) { txtdep_Location.Text = ADepartment.Dep_Location; txtdep_Name.Text = ADepartment.Dep_Name; txtno_Employee.Text = ADepartment.No_Employees.ToString(); } }
public void TestNoEmployeesFound() { //create an instance clsDepartment AnDepartment = new clsDepartment(); //bool variable to store the result of the search Boolean Found = false; //bool variable to record if the data is OK Boolean OK = true; //test data int Dep_ID = 1; //invoke the method Found = AnDepartment.Find(Dep_ID); //check the Department ID if (AnDepartment.No_Employees != 11) { OK = false; } //test to see that the result is correct Assert.IsTrue(OK); }