Example #1
0
        public void EmployeeGetEmployeeByIDAccess()
        {
            //Grab the fake employeeID number
            int ID = TestCleanupAccessor.getTestEmp();
            //Callls to Employee Accessor to grab an employee record by id
            Employee fake = EmployeeAccessor.GetEmployee(ID);

            Assert.AreEqual("Test", fake.FirstName);
        }
Example #2
0
        public void EmployeeUpdateEmployeeAccess()
        {   //Grabs the fake emp ID
            int ID = TestCleanupAccessor.getTestEmp();
            //Grabs the entire Employee record from Accessor
            Employee orig = EmployeeAccessor.GetEmployee(ID);
            //Creates the new employee record with all of the original, changes the active property to false.
            Employee newEmp  = new Employee(orig.FirstName, orig.LastName, orig.Password, (int)orig.Level, false);
            int      changed = EmployeeAccessor.UpdateEmployee(orig, newEmp);

            //Asserts that the update went through with one row affected.
            Assert.AreEqual(1, changed);
        }
Example #3
0
        public void EmployeeManagerEditEmployee()
        {   //Grabs the fake emp id
            int ID = TestCleanupAccessor.getTestEmp();
            //Gets the entire Employee Record
            Employee orig = EmployeeAccessor.GetEmployee(ID);
            //Creates a new employee object with the original properties, update the active property to false.
            Employee newEmp = new Employee(orig.FirstName, orig.LastName, orig.Password, (int)orig.Level, false);
            //calls to manager.
            ResultsEdit result = myManager.EditCurrentEmployee(orig, newEmp);

            //Asserts that the update went through
            Assert.AreEqual(ResultsEdit.Success, result);
        }