예제 #1
0
        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());
        }
예제 #2
0
        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);
        }
예제 #3
0
        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));
        }
예제 #4
0
        public void TestNoApplications()
        {
            var applicantId = Guid.NewGuid();

            Assert.AreEqual(0, _applicationsQuery.GetApplications <ExternalApplication>(applicantId, true).Count);
        }