Example #1
0
        protected JobAd AssertJobAd(Guid posterId, JobAdStatus expectedStatus, JobAdFeatures features)
        {
            var jobAds = _jobAdsQuery.GetJobAds <JobAd>(_jobAdsQuery.GetJobAdIds(posterId));

            Assert.AreEqual(1, jobAds.Count);

            var jobAd = jobAds[0];

            Assert.AreEqual(DefaultTitle, jobAd.Title);
            Assert.AreEqual(DefaultContent, jobAd.Description.Content);
            Assert.IsTrue(new[] { _accounting.Id }.CollectionEqual(jobAd.Description.Industries.Select(i => i.Id)));
            Assert.AreEqual(JobTypes.FullTime, jobAd.Description.JobTypes);
            Assert.AreEqual(expectedStatus, jobAd.Status);

            // Check features.

            Assert.AreEqual(features, jobAd.Features);
            var expectedExpiryTime = expectedStatus != JobAdStatus.Open
                ? (DateTime?)null
                : features.IsFlagSet(JobAdFeatures.ExtendedExpiry)
                    ? DateTime.Now.Date.AddDays(30).AddDays(1).AddSeconds(-1)
                    : DateTime.Now.Date.AddDays(14).AddDays(1).AddSeconds(-1);

            Assert.AreEqual(expectedExpiryTime, jobAd.ExpiryTime);

            return(jobAd);
        }
 protected void AssertPublishPage(JobAdEntry jobAd, JobAdFeatures features)
 {
     AssertUrlWithoutQuery(GetSuggestedCandidatesUrl(jobAd.Id));
     AssertConfirmationMessage(
         "<p>\'"
         + HtmlUtil.HtmlToText(jobAd.Title)
         + "\' was successfully published.</p><p>It will expire on <b>"
         + DateTime.Now.Date.AddDays(features.IsFlagSet(JobAdFeatures.ExtendedExpiry) ? 30 : 14).ToShortDateString()
         + "</b>.</p>");
 }
Example #3
0
 private DateTime GetDefaultExpiryTime(JobAdFeatures features)
 {
     return(DateTime.Now.Date.AddDays(features.IsFlagSet(JobAdFeatures.ExtendedExpiry) ? _extendedExpiryDurationDays : _expiryDurationDays));
 }