IList <Application> IMemberApplicationsQuery.GetApplications(Guid applicantId) { var internalApplications = _applicationsQuery.GetApplications <InternalApplication>(applicantId, true); var externalApplications = _applicationsQuery.GetApplications <ExternalApplication>(applicantId, true); // Due to historic reasons it is possible for some older job ads to have both an internal and external application (not quite sure how ...). // Choose the internal application in these cases. var internalPositionIds = (from a in internalApplications select a.PositionId).ToArray(); return(internalApplications.Cast <Application>().Concat(from a in externalApplications where !internalPositionIds.Contains(a.PositionId) select a).ToList()); }
public void TestEmptyPositions() { var applicantId = Guid.NewGuid(); // Null. Assert.AreEqual(0, _applicationsQuery.GetApplications <InternalApplication>(applicantId, null, true).Count); // Empty. Assert.AreEqual(0, _applicationsQuery.GetApplications <InternalApplication>(applicantId, new Guid[0], true).Count); }
IList <InternalApplication> IJobAdApplicantsQuery.GetApplications(IEmployer employer, Guid applicantId) { // Get all lists that belong to this employer. var positionIds = from l in GetLists(employer.Id) select l.Id; return(_applicationsQuery.GetApplications <InternalApplication>(applicantId, positionIds, false)); }
public void TestNoApplications() { var applicantId = Guid.NewGuid(); Assert.AreEqual(0, _applicationsQuery.GetApplications <ExternalApplication>(applicantId, true).Count); }