Update() public method

public Update ( Employee emp ) : void
emp Employee
return void
    public void Delete_StateUnderTest_ExpectedBehaviorNewEmployee()
    {
        // Arrange
        var newEmp = new EmployeeModel()
        {
            Age        = 33,
            Name       = "Test User",
            State      = "Texas",
            Country    = "USA",
            Department = EmployeeDepartment.IT
        };

        // Act

        // Get Current count of employees
        var initResult = employeeDB.EmployeeCollection().ToArray();

        // Add New Employee with Update
        var addResult = employeeDB.Update(newEmp);
        // Get updated count of employees
        var updatedResult = employeeDB.EmployeeCollection().ToArray();
        /// Delete the Employee
        var result = employeeDB.Delete(addResult.id);
        // Get result after delete
        var finalResult = employeeDB.EmployeeCollection().ToArray();

        // Assert
        Assert.IsNotNull(result);
        Assert.AreEqual(finalResult.Length, initResult.Length);
    }
Esempio n. 2
0
        public ActionResult Edit(EMPLOYEE collection)
        {
            try
            {
                // TODO: Add update logic here
                serviceDb.Update(collection);


                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
Esempio n. 3
0
 public JsonResult Update(Employee emp)
 {
     return(Json(empDB.Update(emp), JsonRequestBehavior.AllowGet));
 }
Esempio n. 4
0
 /// <summary>
 /// update 1 Employee
 /// </summary>
 /// <param name="data"></param>
 /// <returns></returns>
 public static bool UpdateEmployee(Employee data)
 {
     return(EmployeeDB.Update(data));
 }
 public void Put(Employee emp)
 {
     empDB.Update(emp);
 }
Esempio n. 6
0
 public static bool UpdateEmployee(Employee employee)
 {
     return(EmployeeDB.Update(employee));
 }
Esempio n. 7
0
 public JsonResult Actualizar(Employee empleado)
 {
     return(Json(empDB.Update(empleado), JsonRequestBehavior.AllowGet));
 }