test: 增加 MenuHelp 按钮授权单元测试
This commit is contained in:
parent
302976e761
commit
90a42bcf88
|
@ -54,5 +54,12 @@ namespace Bootstrap.DataAccess.SqlServer
|
|||
var roleId = RoleHelper.Retrieves().FirstOrDefault(r => r.RoleName == "Administrators").Id;
|
||||
Assert.True(MenuHelper.SaveMenusByRoleId(roleId, MenuHelper.RetrieveAllMenus("Admin").Select(m => m.Id)));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void AuthorizateButtons_Ok()
|
||||
{
|
||||
Assert.True(MenuHelper.AuthorizateButtons("admin", "~/Admin/Profiles", "saveTheme"));
|
||||
Assert.False(MenuHelper.AuthorizateButtons("admin", "~/Admin/Profiles", "unitTest"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue