public void AddRole(ConnectionModel connectionModel, string name, string description, IEnumerable <string> permissions) { var connection = _securityManagerFactory.GetConnection(connectionModel); var roleId = connection.AddRole(name, description); var actionPermissions = _mapper.MapToActionPermissionModels(permissions); connection.UpdateRolePermissions(roleId, actionPermissions); }
Given_A_List_Of_Permissions_When_I_Call_MapToActionPermissionModels_I_Get_A_List_Of_ActionPermissionModels_Returned() { //act var result = _sut.MapToActionPermissionModels(_permissions); //assert Assert.IsNotNull(result); Assert.IsInstanceOf <List <ActionPermissionModel> >(result); }