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