Exemple #1
0
        void DeleteRoles_No_Service(string name)
        {
            String strErrorResut = String.Empty;

            DeleteRoleService svc = new DeleteRoleService();
            DeleteRoleReq     req = new DeleteRoleReq();

            req.BusinessData.RolName = name;

            try
            {
                DeleteRoleRes res = svc.Execute(req);
            }
            catch (Exception ex)
            {
                if (typeof(TechnicalException) == ex.GetType())
                {
                    Assert.AreEqual <String>("4006", ((TechnicalException)ex).ErrorId, "No se esta validando Rol no vasio");
                }
                else
                {
                    strErrorResut = Fwk.Exceptions.ExceptionHelper.GetAllMessageException(ex);
                }
            }


            Assert.AreEqual <String>(strErrorResut, string.Empty, strErrorResut);
        }
Exemple #2
0
        /// <summary>
        /// Elimina un rol.
        /// El rol no puede tener usuarios asociados.
        /// </summary>
        /// <param name="pRoleName">Nombre del Rol</param>
        public static void DeleteRole(String pRoleName)
        {
            DeleteRoleReq req = new DeleteRoleReq();

            req.BusinessData.RolName = pRoleName;


            DeleteRoleRes res = req.ExecuteService <DeleteRoleReq, DeleteRoleRes>(WrapperSecurityProvider, req);

            if (res.Error != null)
            {
                throw Fwk.Exceptions.ExceptionHelper.ProcessException(res.Error);
            }
        }