public void Test_GetRoleBasedAccessFunctions_ManagerRole() { var result = testCandidate.GetRoleBasedAccessFunctions(userUnitInfoDataDTOList[0]); Assert.IsNotNull(result.Result); Assert.AreEqual(result.Result.Count, 2); Assert.AreEqual(result.Result[0].UserName, "user1"); Assert.AreEqual(result.Result[1].UserName, "user1"); }
/// <summary> /// This method fetches role based functions for the current user /// </summary> /// <param name="userUnitInfo">user unit information</param> /// <returns>functions available for current user</returns> public async Task <List <RoleAccessDTO> > GetRoleBasedAccessFunctions(UserUnitInfoDTO userUnitInfo) { string methodName = typeof(ActionManagerBusinessService) + "." + nameof(GetRoleBasedAccessFunctions); using (loggingHelper.RMTraceManager.StartTrace("BusinessService.GetRoleBasedAccessFunctions")) { loggingHelper.LogMethodEntry(methodName, priority, entryEventId); // mapping public DTO to dataDTO UserUnitInfoDataDTO userUnitInfoDataDTO = GenericMapper.Map <UserUnitInfoDTO, UserUnitInfoDataDTO>(userUnitInfo); var roleAccessDataDto = await actionManagerDataService.GetRoleBasedAccessFunctions(userUnitInfoDataDTO); loggingHelper.LogMethodExit(methodName, priority, exitEventId); // mapping dataDTO to public DTO List <RoleAccessDTO> roleAccessDTO = GenericMapper.MapList <RoleAccessDataDTO, RoleAccessDTO>(roleAccessDataDto); return(roleAccessDTO); } }