public async Task VerifyEditUserFunction() { var userDetail = TestData.GetUsers().Where(x => x.UserId == 34456).FirstOrDefault(); var result = await _manageUser.EditUser(userDetail); _userRepository.Verify(r => r.EditUser(userDetail), Times.Once); }
public async Task <IActionResult> Put(int id, [FromBody] User user) { if (!ModelState.IsValid || user == null || id != user.UserId) { return(BadRequest("Invalid user details.")); } await _manageUser.EditUser(user); return(Ok(user.UserId)); }