コード例 #1
0
ファイル: NewJobAdFlowTests.cs プロジェクト: formist/LinkMe
        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);
        }
コード例 #2
0
        private void CreateNewJobAd(string adContent, JobAdStatus adStatus, IHasId <Guid> adPoster,
                                    bool adHideContactDetails, ContactDetails adContactDetails, string summary, string bulletpoint1, string bulletpoint2,
                                    string bulletpoint3, FileReference logoImg, string adTitle, string positionTitle,
                                    JobTypes jobtypes, bool isResidenacyRequired, string externalRef, decimal?maxsalary,
                                    decimal?minsalary, string package, IList <Industry> reqIndustries, string companyname,
                                    LocationReference jobLocation, DateTime expiryDate)
        {
            var bulletPoints = new[] { bulletpoint1, bulletpoint2, bulletpoint3 };

            var newJobAd = new JobAd
            {
                Status     = adStatus,
                PosterId   = adPoster.Id,
                Visibility =
                {
                    HideContactDetails = adHideContactDetails,
                    HideCompany        = false,
                },
                ContactDetails = adContactDetails,
                Title          = adTitle,
                Integration    = { ExternalReferenceId = externalRef },
                LogoId         = logoImg == null ? (Guid?)null : logoImg.Id,
                ExpiryTime     = expiryDate,
                Description    =
                {
                    CompanyName       = companyname,
                    Content           = adContent,
                    PositionTitle     = positionTitle,
                    ResidencyRequired = isResidenacyRequired,
                    JobTypes          = jobtypes,
                    Industries        = reqIndustries,
                    Summary           = summary,
                    Salary            = (minsalary.HasValue || maxsalary.HasValue
                        ? new Salary
                    {
                        Currency      = Currency.AUD,
                        LowerBound    = minsalary,
                        UpperBound    = maxsalary,
                        Rate          = SalaryRate.Year,
                    }
                        : null),
                    Package      = package,
                    BulletPoints = bulletPoints,
                    Location     = jobLocation,
                }
            };

            _jobAdsCommand.CreateJobAd(newJobAd);

            if (adStatus == JobAdStatus.Open)
            {
                _jobAdsCommand.OpenJobAd(newJobAd);
            }
            else if (adStatus == JobAdStatus.Closed)
            {
                _jobAdsCommand.CloseJobAd(newJobAd);
            }

            return;
        }
コード例 #3
0
 public ManageCandidatesNavigation(Guid jobAdId, JobAdStatus jobAdStatus, ApplicantStatus applicantStatus, CandidatesPresentationModel presentation)
     : base(presentation)
 {
     JobAdId         = jobAdId;
     JobAdStatus     = jobAdStatus;
     ApplicantStatus = applicantStatus;
 }
コード例 #4
0
ファイル: ContentTests.cs プロジェクト: formist/LinkMe
        private JobAd CreateJobAd(IHasId <Guid> employer, JobAdStatus status)
        {
            var jobAd = new JobAd
            {
                Id          = Guid.NewGuid(),
                Status      = status,
                Title       = "Best Job in the World",
                CreatedTime = DateTime.Now,
                PosterId    = employer.Id,
                Description =
                {
                    BulletPoints = new[]               { "good verbal communication", "self management and independency", "bullet point 3" },
                    Content      = "Mutley, you snickering, floppy eared hound. When courage is needed, you're never around.",
                    JobTypes     = JobTypes.FullTime,
                    Industries   = new List <Industry> {
                        _industriesQuery.GetIndustry("Engineering")
                    },
                },
            };

            _jobAdsCommand.CreateJobAd(jobAd);
            _jobAdsCommand.OpenJobAd(jobAd);
            if (status == JobAdStatus.Closed)
            {
                _jobAdsCommand.CloseJobAd(jobAd);
            }
            return(jobAd);
        }
コード例 #5
0
 public SuggestedCandidatesNavigation(Guid jobAdId, string jobAdTitle, JobAdStatus jobAdStatus, MemberSearchCriteria criteria, CandidatesPresentationModel presentation)
     : base(criteria, presentation)
 {
     JobAdId     = jobAdId;
     JobAdTitle  = jobAdTitle;
     JobAdStatus = jobAdStatus;
 }
コード例 #6
0
ファイル: JobAdsRepository.cs プロジェクト: formist/LinkMe
        void IJobAdsRepository.ChangeStatus(Guid jobAdId, JobAdStatus newStatus, DateTime?newExpiryTime, DateTime time)
        {
            using (var dc = CreateContext())
            {
                // Update the status on the job ad itself.

                var entity         = GetJobAdEntity(dc, jobAdId);
                var previousStatus = entity.status;
                entity.status          = (byte)newStatus;
                entity.lastUpdatedTime = time;

                if (newExpiryTime != null)
                {
                    entity.expiryTime = newExpiryTime.Value;
                }

                // Record the change.

                var change = new JobAdStatusChange
                {
                    Id             = Guid.NewGuid(),
                    Time           = time,
                    PreviousStatus = (JobAdStatus)previousStatus,
                    NewStatus      = newStatus
                };
                dc.JobAdStatusEntities.InsertOnSubmit(change.Map(jobAdId));

                dc.SubmitChanges();
            }
        }
コード例 #7
0
ファイル: JobAdsRepository.cs プロジェクト: formist/LinkMe
 IList <Guid> IJobAdsRepository.GetJobAdIds(Guid posterId, JobAdStatus status)
 {
     using (var dc = CreateContext().AsReadOnly())
     {
         return(GetJobAdIds(dc, posterId, status).ToList());
     }
 }
コード例 #8
0
        protected void AssertJobAd(Guid jobAdId, JobAdStatus expectedStatus, DateTime?expectedExpiryTime)
        {
            var jobAd = _jobAdsQuery.GetJobAd <JobAdEntry>(jobAdId);

            Assert.IsNotNull(jobAd);
            Assert.AreEqual(expectedStatus, jobAd.Status);
            Assert.AreEqual(expectedExpiryTime, jobAd.ExpiryTime);
        }
コード例 #9
0
ファイル: JobAdStatusTests.cs プロジェクト: formist/LinkMe
 private void AssertStatus(JobAdStatus expectedStatus, DateTime?expectedExpiryTime, JobAd jobAd)
 {
     Assert.AreEqual(expectedStatus, jobAd.Status);
     Assert.AreEqual(expectedExpiryTime, jobAd.ExpiryTime);
     jobAd = _jobAdsQuery.GetJobAd <JobAd>(jobAd.Id);
     Assert.AreEqual(expectedStatus, jobAd.Status);
     Assert.AreEqual(expectedExpiryTime, jobAd.ExpiryTime);
 }
コード例 #10
0
        private JobAd CreateNewJobAd(string adContent, JobAdStatus adStatus, IHasId <Guid> adPoster,
                                     bool adHideContactDetails, ContactDetails adContactDetails, string summary, string bulletpoint1, string bulletpoint2,
                                     string bulletpoint3, FileReference logoImg, string adTitle, string positionTitle,
                                     JobTypes jobtypes, bool isResidenacyRequired, string externalRef, string maxsalary,
                                     string minsalary, string package, IList <Industry> reqIndustries, string companyname,
                                     LocationReference jobLocation, DateTime expiryDate)
        {
            var salary       = SalaryExtensions.Parse(minsalary, maxsalary, SalaryRate.Year, true);
            var bulletPoints = new[] { bulletpoint1, bulletpoint2, bulletpoint3 };

            var newJobAd = new JobAd
            {
                Status     = adStatus,
                PosterId   = adPoster.Id,
                Visibility =
                {
                    HideContactDetails = adHideContactDetails,
                    HideCompany        = false,
                },
                ContactDetails = adContactDetails,
                Title          = adTitle,
                Integration    = { ExternalReferenceId = externalRef },
                LogoId         = logoImg == null ? (Guid?)null : logoImg.Id,
                ExpiryTime     = expiryDate,
                Description    =
                {
                    CompanyName       = companyname,
                    Content           = adContent,
                    PositionTitle     = positionTitle,
                    ResidencyRequired = isResidenacyRequired,
                    JobTypes          = jobtypes,
                    Industries        = reqIndustries,
                    Summary           = summary,
                    Salary            = salary,
                    Package           = package,
                    BulletPoints      = bulletPoints,
                    Location          = jobLocation,
                }
            };

            _jobAdsCommand.CreateJobAd(newJobAd);
            _jobAdsCommand.OpenJobAd(newJobAd);

            return(newJobAd);
        }
コード例 #11
0
ファイル: MaintainJobAdTests.cs プロジェクト: formist/LinkMe
        protected JobAd CreateJobAd(IEmployer employer, JobAdStatus status)
        {
            var jobAd = employer.CreateTestJobAd();

            _employerJobAdsCommand.CreateJobAd(employer, jobAd);

            switch (status)
            {
            case JobAdStatus.Open:
                _employerJobAdsCommand.OpenJobAd(employer, jobAd, false);
                break;

            case JobAdStatus.Closed:
                _employerJobAdsCommand.OpenJobAd(employer, jobAd, false);
                _employerJobAdsCommand.CloseJobAd(employer, jobAd);
                break;
            }

            return(jobAd);
        }
コード例 #12
0
        protected JobAd CreateJobAd(IEmployer employer, JobAdStatus status, DateTime createdTime, DateTime?expiryTime)
        {
            var jobAd = employer.CreateTestJobAd();

            _employerJobAdsCommand.CreateJobAd(employer, jobAd);

            switch (status)
            {
            case JobAdStatus.Open:
                _employerJobAdsCommand.OpenJobAd(employer, jobAd, false);
                break;

            case JobAdStatus.Closed:
                _employerJobAdsCommand.OpenJobAd(employer, jobAd, false);
                _employerJobAdsCommand.CloseJobAd(employer, jobAd);
                break;
            }

            jobAd.CreatedTime = createdTime;
            jobAd.ExpiryTime  = expiryTime;
            _jobAdsCommand.UpdateJobAd(jobAd);

            return(jobAd);
        }
コード例 #13
0
 private void AssertJobAd(IntegratorUser integratorUser, JobAdStatus expectedStatus, JobAdElement expectedJobAd, IEnumerable <JobAd> jobAds)
 {
     AssertJobAd(expectedJobAd, AssertJobAd((from j in jobAds where j.Integration.ExternalReferenceId == expectedJobAd.ExternalReferenceId select j).Single(), integratorUser, expectedJobAd.ExternalReferenceId, expectedStatus));
 }
コード例 #14
0
 IList <Guid> IJobAdsRepository.GetJobAdIds(Guid posterId, JobAdStatus status)
 {
     throw new NotImplementedException();
 }
コード例 #15
0
ファイル: PostJobAdsTests.cs プロジェクト: formist/LinkMe
        protected JobAd AssertJobAd(IntegratorUser integratorUser, Guid employerId, string externalReferenceId, JobAdStatus expectedStatus)
        {
            var jobAds = _jobAdsQuery.GetJobAds <JobAd>(_jobAdIntegrationQuery.GetJobAdIds(integratorUser.Id, employerId, externalReferenceId));

            Assert.AreEqual(1, jobAds.Count);
            return(AssertJobAd(jobAds[0], integratorUser, externalReferenceId, expectedStatus));
        }
コード例 #16
0
        private SuggestedCandidatesListModel Search(IEmployer employer, Guid jobAdId, MemberSearchCriteria criteria, CandidatesPresentationModel presentation, string jobAdTitle, JobAdStatus jobAdStatus)
        {
            var searchList = GetSearchList(Search(employer, jobAdId, criteria, presentation));

            searchList.JobAd = new JobAdDataModel
            {
                Id     = jobAdId,
                Title  = jobAdTitle,
                Status = jobAdStatus,
            };

            return(searchList);
        }
コード例 #17
0
 void IJobAdsRepository.ChangeStatus(Guid jobAdId, JobAdStatus status, DateTime?expiryTime, DateTime updatedTime)
 {
 }
コード例 #18
0
ファイル: JobAdTestExtensions.cs プロジェクト: formist/LinkMe
 public static JobAd PostTestJobAd(this IJobAdsCommand jobAdsCommand, IEmployer employer, JobAdStatus jobStatus)
 {
     return(PostTestJobAd(jobAdsCommand, employer.CreateTestJobAd(), jobStatus));
 }
コード例 #19
0
ファイル: PostJobAdsTests.cs プロジェクト: formist/LinkMe
 protected JobAd AssertJobAd(JobAd jobAd, IntegratorUser integratorUser, string externalReferenceId, JobAdStatus expectedStatus)
 {
     Assert.IsNotNull(jobAd);
     Assert.AreEqual(integratorUser.Id, jobAd.Integration.IntegratorUserId);
     Assert.AreEqual(externalReferenceId, jobAd.Integration.ExternalReferenceId);
     Assert.AreEqual(expectedStatus, jobAd.Status);
     return(jobAd);
 }
コード例 #20
0
ファイル: JobAdsQuery.cs プロジェクト: formist/LinkMe
 IList <Guid> IJobAdsQuery.GetJobAdIds(Guid posterId, JobAdStatus status)
 {
     return(_repository.GetJobAdIds(posterId, status));
 }
コード例 #21
0
ファイル: JobAdTestExtensions.cs プロジェクト: formist/LinkMe
        private static JobAd PostTestJobAd(this IJobAdsCommand jobAdsCommand, JobAd jobAd, JobAdStatus jobStatus)
        {
            jobAdsCommand.CreateJobAd(jobAd);
            switch (jobStatus)
            {
            case JobAdStatus.Open:
                jobAdsCommand.OpenJobAd(jobAd);
                break;

            case JobAdStatus.Closed:
                jobAdsCommand.OpenJobAd(jobAd);
                jobAdsCommand.CloseJobAd(jobAd);
                break;

            case JobAdStatus.Deleted:
                jobAdsCommand.DeleteJobAd(jobAd);
                break;
            }

            return(jobAd);
        }
コード例 #22
0
ファイル: JobAdTestExtensions.cs プロジェクト: formist/LinkMe
 public static JobAd PostTestJobAd(this IJobAdsCommand jobAdsCommand, AnonymousUser user, JobAdStatus jobStatus)
 {
     return(PostTestJobAd(jobAdsCommand, user.CreateTestJobAd(), jobStatus));
 }
コード例 #23
0
ファイル: PublishedEvents.cs プロジェクト: formist/LinkMe
 public JobAdOpenedEventArgs(Guid jobAdId, JobAdStatus previousStatus)
     : base(jobAdId)
 {
     PreviousStatus = previousStatus;
 }
コード例 #24
0
ファイル: JobAdTestExtensions.cs プロジェクト: formist/LinkMe
        private static JobAd PostTestJobAd(this IJobAdsCommand jobAdsCommand, JobAd jobAd, JobAdStatus jobStatus)
        {
            jobAdsCommand.CreateJobAd(jobAd);
            switch (jobStatus)
            {
            case JobAdStatus.Open:
                jobAdsCommand.OpenJobAd(jobAd);
                break;

            case JobAdStatus.Closed:
                jobAdsCommand.OpenJobAd(jobAd);
                jobAdsCommand.CloseJobAd(jobAd);
                break;

            case JobAdStatus.Deleted:
                jobAdsCommand.DeleteJobAd(jobAd);
                break;

            default:
                //do nothing - job is created in draft state
                break;
            }

            return(jobAd);
        }