Beispiel #1
0
        private void AssertApplication(JobAd jobAd, Application application)
        {
            var applicationNodes = GetApplicationNodes();

            Assert.AreEqual(1, applicationNodes.Count);
            AssertApplication(applicationNodes[0], jobAd, application);
        }
 protected bool EnableDelete(Application application)
 {
     if (application is InternalApplication)
     {
         var jobAd = _jobAds[application.PositionId];
         return(jobAd.Processing == JobAdProcessing.ManagedInternally);
     }
     return(false);
 }
Beispiel #3
0
        protected void AssertPreviousApplication(JobAd jobAd, Application application)
        {
            Get(_previousApplicationsUrl);
            AssertUrl(_previousApplicationsUrl);

            var nodes = Browser.CurrentHtml.DocumentNode.SelectNodes("//table[@id='job-ad-table']//td");

            Assert.AreEqual(4, nodes.Count);

            var a = nodes[0].SelectSingleNode("./a");

            Assert.AreEqual(GetJobText(jobAd), a.InnerText.Trim());
            Assert.AreEqual(application.CreatedTime.ToShortDateString(), nodes[1].SelectSingleNode("./div").InnerText.Trim());
            Assert.AreEqual(GetStatusText(jobAd, application), nodes[2].InnerText.Trim());
        }
Beispiel #4
0
        private static string GetStatusText(JobAdEntry jobAd, Application application)
        {
            if (application is ExternalApplication)
            {
                return("Managed externally");
            }

            if (((InternalApplication)application).IsPending)
            {
                return(!string.IsNullOrEmpty(jobAd.Integration.ExternalApplyUrl)
                    ? "Pending (external site)Complete application"
                    : "Managed externally");
            }

            return("New");
        }
        protected string GetStatusText(Application application)
        {
            if (application == null)
            {
                return(string.Empty);
            }

            if (application is ExternalApplication)
            {
                return("Managed externally");
            }

            var internalApplication = (InternalApplication)application;
            var status = _jobAdApplicantsQuery.GetApplicantStatus(application.Id);

            switch (status)
            {
            case ApplicantStatus.New:

                var jobAd = _jobAds[application.PositionId];
                if (jobAd.Processing != JobAdProcessing.ManagedInternally)
                {
                    if (internalApplication.IsPending && !string.IsNullOrEmpty(jobAd.Integration.ExternalApplyUrl))
                    {
                        var applyLink = GetPopupATag(jobAd.GetExternalApplyUrl(internalApplication.Id), JobAdFacade.GetExternalApplyPopupWindowName(jobAd), "Complete application");
                        return("Pending (external site)" + StringUtils.HTML_LINE_BREAK + applyLink);
                    }
                    return("Managed externally");
                }

                return("New");

            case ApplicantStatus.Shortlisted:
                return("Shortlisted");

            case ApplicantStatus.Rejected:
                return("Declined");

            default:
                return("Managed externally");
            }
        }
Beispiel #6
0
 private void AssertApplication(HtmlNode node, JobAd jobAd, Application application)
 {
     Assert.AreEqual(GetJobAdUrl(jobAd).Path.ToLower(), node.SelectSingleNode("td/a").Attributes["href"].Value.ToLower());
     Assert.AreEqual(application is InternalApplication ? "New" : "Managed externally", node.SelectSingleNode("td[position()=3]").InnerText.Trim());
 }