public (PersonWithStaff toApprove, List <PersonWithStaff> toNotify) ResolveLeaveRequestEmails( PersonWithStaff requestedBy) { return(ResolveLeaveRequestEmails(requestedBy, _orgGroupRepository.StaffParentOrgGroups(requestedBy.Staff), _orgGroupRepository.GetOrgGroupsByPersonsRole(requestedBy.Id))); }
public void OrgsByReportingStaffResolvesAsExpected() { var reportingOrgs = _groupRepository.StaffParentOrgGroups(org1aStaff.Staff); reportingOrgs.ShouldContain(org => org.Id == org1a.Id); reportingOrgs.ShouldContain(org => org.Id == org1.Id); reportingOrgs.ShouldNotContain(org => org.Id == org2.Id); reportingOrgs.ShouldNotContain(org => org.Id == org2a.Id); reportingOrgs.ShouldNotContain(org => org.Id == orgRoot.Id); reportingOrgs.Count().ShouldBe(2); reportingOrgs = _groupRepository.StaffParentOrgGroups(org2aStaff.Staff); reportingOrgs.ShouldNotContain(org => org.Id == org2a.Id); reportingOrgs.ShouldNotContain(org => org.Id == org1.Id); reportingOrgs.ShouldNotContain(org => org.Id == org1a.Id); reportingOrgs.ShouldNotContain(org => org.Id == orgRoot.Id); reportingOrgs.ShouldHaveSingleItem().Id.ShouldBe(org2.Id); }