示例#1
0
        //[TestMethod]
        public int? CreateRulesCategory_No_Service()
        {
           
            String strErrorResut = String.Empty;
            CreateRulesCategoryService svc = new CreateRulesCategoryService();
            CreateRulesCategoryReq req = new CreateRulesCategoryReq();
            CreateRulesCategoryRes res = new Fwk.Security.ISVC.CreateRulesCategory.CreateRulesCategoryRes();

            req.BusinessData.Name = "Categorytest_1";
            req.BusinessData.ParentId = 0;
            req.BusinessData.FwkRulesInCategoryList = new FwkAuthorizationRuleList();
            req.BusinessData.FwkRulesInCategoryList.Add(new FwkAuthorizationRule ("Rule_1",""));
            req.BusinessData.FwkRulesInCategoryList.Add(new FwkAuthorizationRule("Rule_2", ""));
            req.BusinessData.FwkRulesInCategoryList.Add(new FwkAuthorizationRule("Rule_3", ""));

            req.SecurityProviderName = SecurityProviderName;

            Int32? id = null;
            try
            {
                res = svc.Execute(req);
                id =  res.BusinessData.Id;
                //base.Tx.Abort();
            }
            catch (Exception ex)
            {
                strErrorResut = Fwk.Exceptions.ExceptionHelper.GetAllMessageException(ex);
               
            }

            Assert.AreEqual<String>(strErrorResut, string.Empty, strErrorResut);
            return id;
        }
示例#2
0
        //[TestMethod]
        public int?CreateRulesCategory_No_Service()
        {
            String strErrorResut           = String.Empty;
            CreateRulesCategoryService svc = new CreateRulesCategoryService();
            CreateRulesCategoryReq     req = new CreateRulesCategoryReq();
            CreateRulesCategoryRes     res = new Fwk.Security.ISVC.CreateRulesCategory.CreateRulesCategoryRes();

            req.BusinessData.Name     = "Categorytest_1";
            req.BusinessData.ParentId = 0;
            req.BusinessData.FwkRulesInCategoryList = new FwkAuthorizationRuleList();
            req.BusinessData.FwkRulesInCategoryList.Add(new FwkAuthorizationRule("Rule_1", ""));
            req.BusinessData.FwkRulesInCategoryList.Add(new FwkAuthorizationRule("Rule_2", ""));
            req.BusinessData.FwkRulesInCategoryList.Add(new FwkAuthorizationRule("Rule_3", ""));

            req.SecurityProviderName = SecurityProviderName;

            Int32?id = null;

            try
            {
                res = svc.Execute(req);
                id  = res.BusinessData.Id;
                //base.Tx.Abort();
            }
            catch (Exception ex)
            {
                strErrorResut = Fwk.Exceptions.ExceptionHelper.GetAllMessageException(ex);
            }

            Assert.AreEqual <String>(strErrorResut, string.Empty, strErrorResut);
            return(id);
        }