public void RetrievesByUserId_Ok() { var userId = UserHelper.Retrieves().FirstOrDefault(r => r.UserName == "Admin").Id; var groups = GroupHelper.RetrievesByUserId(userId); Assert.NotNull(groups); }
public void RetrieveRolesByGroupId_Ok() { var id = RoleHelper.Retrieves().FirstOrDefault(r => r.RoleName == "Administrators").Id; GroupHelper.SaveByRoleId(id, GroupHelper.Retrieves().Select(g => g.Id)); Assert.NotEmpty(RoleHelper.RetrievesByGroupId(GroupHelper.Retrieves().Where(g => g.GroupName == "Admin").FirstOrDefault().Id).Where(r => r.Checked == "checked")); }
public void SaveByGroupId_Ok() { var groupId = GroupHelper.Retrieves().FirstOrDefault(g => g.GroupName == "Admin").Id; var id = UserHelper.Retrieves().FirstOrDefault(u => u.UserName == "Admin").Id; Assert.True(UserHelper.SaveByGroupId(groupId, new string[] { id })); var users = UserHelper.RetrievesByGroupId(groupId); Assert.NotEmpty(users.Where(u => u.Checked == "checked")); Assert.True(UserHelper.SaveByGroupId(groupId, new string[0])); }
public void SaveAndDelete_Ok() { var g = new Group() { GroupCode = "002", GroupName = "UnitTest", Description = "UnitTestSave" }; // insert Assert.True(GroupHelper.Save(g)); // update Assert.True(GroupHelper.Save(g)); // delete Assert.True(GroupHelper.Delete(new string[] { g.Id })); }
public void SaveByGroupId_Ok() { var gId = GroupHelper.Retrieves().FirstOrDefault(g => g.GroupName == "Admin").Id; RoleHelper.SaveByGroupId(gId, RoleHelper.Retrieves().Where(r => r.RoleName == "Administrators").Select(r => r.Id)); }
public void Retrieves_Ok() { Assert.NotEmpty(GroupHelper.Retrieves()); }
public void RetrievesByUserName_Ok() { Assert.NotNull(GroupHelper.RetrievesByUserName("Admin")); }
public void SaveByRoleId_Ok() { var roleId = RoleHelper.Retrieves().FirstOrDefault(r => r.RoleName == "Administrators").Id; Assert.True(GroupHelper.SaveByRoleId(roleId, GroupHelper.Retrieves().Select(g => g.Id))); }
public void SaveByUserId_Ok() { var userId = UserHelper.Retrieves().FirstOrDefault(r => r.UserName == "Admin").Id; Assert.True(GroupHelper.SaveByUserId(userId, GroupHelper.Retrieves().Select(g => g.Id))); }
public void RetrievesByRoleId_Ok() { var groups = GroupHelper.RetrievesByRoleId(RoleHelper.Retrieves().Where(r => r.RoleName == "Administrators").First().Id); Assert.NotEmpty(groups); }