Beispiel #1
0
        public void FindMethodOK()
        {
            //Create an instance of Staffing
            Staffing staffT = new Staffing();
            //Boolean varibable to store the result of the validation
            Boolean Found = false;
            //Create some test data to use with the method
            Int32 staffID = 14;

            //Invoke the method
            Found = staffT.Find(staffID);
            //Test to see if ther esult is correct
            Assert.IsTrue(Found);
        }
Beispiel #2
0
        public void TestStaffValidFound()
        {
            //Create an instance of Staffing
            Staffing staffT = new Staffing();
            //Boolean varibable to store the result of the validation
            Boolean Found = false;
            //Bool to record if the data is OK (assume it is)
            Boolean OK = true;
            //Create some test data to use with the method
            Int32 StaffID = 14;

            //Invoke the method
            Found = staffT.Find(StaffID);

            //Check the stafDOB value against what should be found
            if (staffT.staffValid != true)
            {
                OK = false;
            }
            //test to see if the result is correct
            Assert.IsTrue(OK);
        }
Beispiel #3
0
    protected void btnFind_Click(object sender, EventArgs e)
    {
        //Create an isntance of the staffing
        Staffing AStaff = new Staffing();
        //Variable to store the primary key
        Int32 StaffID;
        //Variable to indicate if found
        Boolean Found = false;

        //get the primary key entered by the user
        StaffID = Convert.ToInt32(txtID.Text);
        //find the record
        Found = AStaff.Find(StaffID);
        //If Found
        if (Found == true)
        {
            txtFirstName.Text = AStaff.staffName.getFirstName();
            txtLastName.Text  = AStaff.staffName.getLastName();
            txtEmail.Text     = AStaff.staffEmail;
            txtNumber.Text    = AStaff.staffNumber;
            txtDOB.Text       = AStaff.staffDOB.ToString();
        }
    }
Beispiel #4
0
        public void TestStaffNameFound()
        {
            //Create an instance of Staffing
            Name     staffN = new Name("Eugene", "Zuccerberg");
            Staffing staffT = new Staffing();
            //Boolean varibable to store the result of the validation
            Boolean Found = false;
            //Bool to record if the data is OK (assume it is)
            Boolean OK = true;
            //Create some test data to use with the method
            Int32 StaffID = 14;

            //Invoke the method
            Found = staffT.Find(StaffID);

            //Grab the full name and compare it to what should be found
            if (staffT.staffName.getFullName() != staffN.getFullName())
            {
                OK = false;
            }
            //test to see if the result is correct
            Assert.IsTrue(OK);
        }