Ejemplo n.º 1
0
        public void EmployeeGetEmployeeLoginAccess()
        {
            //Grabs the fake emp ID
            int      ID   = TestCleanupAccessor.getTestEmp();
            Employee fake = EmployeeAccessor.GetEmployeeLogin(ID, Password);

            //Asserts that the employee record being returned matches the fake employee record in the setup
            Assert.AreEqual("Test", fake.FirstName);
        }
Ejemplo n.º 2
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);
        }
Ejemplo n.º 3
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);
        }