Beispiel #1
0
        public void GetRoleAuthToRoleId()
        {
            SystemRoleAuthorityService sras = new SystemRoleAuthorityService();
            var id = 1;

            Assert.IsTrue(sras.GetAll(id) != null);
            foreach (var item in sras.GetAll(id))
            {
                Console.WriteLine(item.ModuleName);
            }
        }
Beispiel #2
0
        public void testUpdate()
        {
            SystemRoleAuthorityService sras = new SystemRoleAuthorityService();
            SystemRoleAuthority        sra  = new SystemRoleAuthority();

            sra.Id         = 1;
            sra.ModuleName = "客户";
            sra.RoleId     = 1;
            sra.IsLock     = 0;
            sras.Update(sra);
            sras.SaveChanges();
            Assert.IsTrue(sra.IsLock == sras.GetRoleAuth(1).IsLock);
            Console.WriteLine(sras.GetRoleAuth(1).IsLock);
        }