public async Task EditFunctionRights() { var id = _dbFaker.Functions.FirstOrDefault().Id; var ids = _dbFaker.AccessRights.Take(3).Select(l => l.Id).ToArray(); var response = await _securityData.EditFunctionRights(id, ids); Assert.AreEqual(ActionStatus.Success, response.Status, response.Message); _mock.Verify(data => data.EditFunctionRights(id, ids), () => Times.Exactly(1)); }
public async Task <IActionResult> EditFunction([FromBody] EditFunctionRequest request) { var result = _securityService.EditFunctionRights(request.FunctionId, request.RightIds); return(Ok(await result)); }