public async Task VerifyDeleteUserFunction() { var userDetail = TestData.GetUsers().Where(x => x.UserId == 33).FirstOrDefault(); var result = await _manageUser.DeleteUser(userDetail); _userRepository.Verify(r => r.DeleteUser(userDetail), Times.Once); }
public async Task <IActionResult> Delete(int id) { var userDetails = await _manageUser.GetUser(id); if (userDetails == null) { return(BadRequest("User Details not found with id:" + id)); } await _manageUser.DeleteUser(userDetails); return(Ok(userDetails.UserId)); }