public void Test_Delete_Employee() { //Arrange mockEmployee.Setup(x => x.DeleteEmployee(It.IsAny <string>())).Returns("success"); //Act var actualData = employeeBAL.DeleteEmployee("M100"); //Assert Assert.AreEqual("success", actualData); }
public IHttpActionResult DeleteEmployee(string empID) { string retVal = bal_object.DeleteEmployee(empID); if (retVal == "success" || retVal == "failed") { return(Content(HttpStatusCode.NoContent, retVal)); } else if (retVal == "NotFound") { return(Content(HttpStatusCode.NotFound, "ID Not Found")); } return(InternalServerError()); }