public IHttpActionResult AddEmployee(EmployeeEntity employee) { string retVal = bal_object.AddEmployee(employee); if (retVal != null) { return(Content(HttpStatusCode.Created, retVal)); } //else //{ // return NotFound(); //} return(InternalServerError()); }
public void Test_Add_Employee() { //Arrange EmployeeEntity empData = new EmployeeEntity() { Name = "Sanjay Kumar", EmployeeID = "M100", UserLocation = "Texas", EmailID = "*****@*****.**" }; mockEmployee.Setup(x => x.AddEmployee(It.IsAny <EmployeeDetail>())).Returns("success"); //Act var data = employeeBAL.AddEmployee(empData); //Assert Assert.AreEqual("success", data); }