Example #1
0
 public (PersonWithStaff toApprove, List <PersonWithStaff> toNotify) ResolveLeaveRequestEmails(
     PersonWithStaff requestedBy)
 {
     return(ResolveLeaveRequestEmails(requestedBy,
                                      _orgGroupRepository.StaffParentOrgGroups(requestedBy.Staff),
                                      _orgGroupRepository.GetOrgGroupsByPersonsRole(requestedBy.Id)));
 }
Example #2
0
        public void OrgsByRolesResolvesAsExpected()
        {
            _sf.InsertRoleAndJob(org1aStaff.Id, jobOrgGroupId: org2a.Id);
            _sf.InsertRoleAndJob(org1aStaff.Id, jobOrgGroupId: org1a.Id);
            var orgs = _groupRepository.GetOrgGroupsByPersonsRole(org1aStaff.Id);

            orgs.ShouldContain(org => org.Id == org1a.Id);
            orgs.ShouldContain(org => org.Id == org2.Id);

            orgs.ShouldNotContain(org => org.Id == org2a.Id);
            orgs.ShouldNotContain(org => org.Id == org1.Id);
            orgs.ShouldNotContain(org => org.Id == orgRoot.Id);
            orgs.Count.ShouldBe(2);
        }