public void EmployeeAddEmployeeAccess() { //Adds fake employee to Data base int rows = EmployeeAccessor.AddEmployee(testEmp); //Asserts that one row was affected. Assert.AreEqual(1, rows); }
/// <summary> /// Ryan Blake /// Created: 2015/02/12 /// Method takes in newEmployee and passes it as a parameter into the AddEmployee method of the EmployeeAccessor class /// </summary> /// <remarks> /// Tony Noel /// Updated: 2015/04/13 /// Updated to comply with the ResultsEdit class of error codes. /// </remarks> /// <param name="newEmployee">The Employee object containing the new employee information to be added</param> /// <exception cref="Exception">Exception is thrown if database is not available or new employee cannot be created in the database for any reason</exception> /// <returns>Success: A ResultsEdit.Success value is returned</returns> public ResultsEdit AddNewEmployee(Employee newEmployee) { try { int worked = EmployeeAccessor.AddEmployee(newEmployee); if (worked == 1) { return(ResultsEdit.Success); } } catch (Exception ex) { throw ex; } return(ResultsEdit.DatabaseError); }
public void addEMP() { //Adds the fake record. int rows = EmployeeAccessor.AddEmployee(testEmp); }