public void RetrieveRolesByMenuId_Ok() { var roleId = RoleHelper.Retrieves().FirstOrDefault(r => r.RoleName == "Administrators").Id; MenuHelper.SaveMenusByRoleId(roleId, MenuHelper.RetrieveAllMenus("Admin").Select(m => m.Id)); var rs = RoleHelper.RetrievesByMenuId(MenuHelper.RetrieveAllMenus("Admin").FirstOrDefault().Id).Where(r => r.Checked == "checked"); Assert.NotEmpty(rs); }
public void SaveMenusByRoleId_Ok() { var roleId = RoleHelper.Retrieves().FirstOrDefault(r => r.RoleName == "Administrators").Id; Assert.True(MenuHelper.SaveMenusByRoleId(roleId, MenuHelper.RetrieveAllMenus("Admin").Select(m => m.Id))); }