public void AssignRoles() { var roles = new List <Role>(); var role = _agency.CreateRole("Role name", "Role description"); roles.Add(role); _administrationUnitOfWork.Setup(item => item.Find <Template>(It.IsAny <Guid>(), It.IsAny <TrackingMode>(), It.IsAny <ThrowIf>())) .Returns(_arrestTemplate); _administrationUnitOfWork.Setup(item => item.GetEntityQuery <Role>(TrackingMode.Automatic)).Returns(roles.AsQueryable); _templateCommandService.AssignRoles(_arrestTemplate.Id, roles.Select(item => item.Id).ToList()); _administrationUnitOfWork.Verify(mock => mock.Commit(It.IsAny <ConcurrencyMode>()), Times.Once); _arrestTemplate.AssignedRoles.Should().NotBeEmpty(); }
private void SetUpRole() { var role = _agency.CreateRole(string.Concat("Admin Role", Guid.NewGuid()), "Role Description"); var roleList = new List <Role>(); roleList.Add(role); _administrationUnitOfWork.Setup(item => item.GetEntityQuery <Role>(It.IsAny <TrackingMode>())).Returns(roleList.AsQueryable); }
private void RoleSetup() { var roleList = new List <Role>(); _role = _agency.CreateRole("Allowed Templates Role", "Role Description"); roleList.Add(_role); _administrationUnitOfWork.Setup(item => item.GetEntityQuery <Role>(TrackingMode.Automatic)) .Returns(roleList.AsQueryable); }
private void SetUpRole() { var roleList = new List <Role>(); var role = _agency.CreateRole(string.Concat("Workflow Role", Guid.NewGuid()), "Role Description"); roleList.Add(role); var workflowInstanceRole = new WorkflowInstanceRole(); workflowInstanceRole.RoleId = role.Id; _report.WorkflowInstance.WorkflowInstanceRoles.Add(workflowInstanceRole); _administrationUnitOfWork.Setup(mock => mock.GetEntityQuery <Role>(TrackingMode.Automatic)).Returns(roleList.AsQueryable); }
private void SetUpRole() { var role = _agency.CreateRole(string.Concat("Admin Role", Guid.NewGuid()), "Role Description"); var workflowInstanceRole = new WorkflowInstanceRole(); workflowInstanceRole.RoleId = role.Id; _report.WorkflowInstance.WorkflowInstanceRoles.Add(workflowInstanceRole); var assignedRole = _identity.AssignRole(role); var assignedRoleList = new List <AssignedRole>(); assignedRoleList.Add(assignedRole); _administrationUnitOfWork.Setup(item => item.GetEntityQuery <AssignedRole>(It.IsAny <TrackingMode>())).Returns(assignedRoleList.AsQueryable); }
private void CreateRole() { _roles.Add(_agency.CreateRole(string.Concat("Admin Role", Guid.NewGuid()), "Role Description")); }