test: 增加 MenuHelp 按钮授权单元测试

This commit is contained in:
Argo Zhang 2019-09-06 12:21:30 +08:00
parent 302976e761
commit 90a42bcf88
No known key found for this signature in database
GPG Key ID: 152E398953DDF19F
1 changed files with 7 additions and 0 deletions

View File

@ -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"));
}
}
}