public async Task DeleteEmployeeAsync_WithEmployeeIdOfZero_ReturnsNull() { var employeeId = 0; var result = await employeeBL.DeleteEmployeeAsync(employeeId); Assert.IsNull(result); }
public async Task <IHttpActionResult> Delete(int employeeId) { var result = await employeeBL.DeleteEmployeeAsync(employeeId); if (result != null) { return(Ok(mapper.Map <EmployeeModel>(result))); } return(Content(HttpStatusCode.NotFound, AppConstants.HttpErrorMessage.ResourceNotFound)); }
public async Task DeleteEmployeeAsync_WithEmployeeIdGreaterThanZero_ReturnsEmployeeDTO() { MockEmployeeDL .Stub(x => x.DeleteEmployeeAsync(Arg <int> .Is.Anything)) .Return(Task.FromResult(new EmployeeDTO())); var employeeId = 1; var result = await employeeBL.DeleteEmployeeAsync(employeeId); Assert.IsNotNull(result); }