Ejemplo n.º 1
0
        public void TestInitialize()
        {
            _employmentHistoryUrl = new ReadOnlyApplicationUrl(true, "~/members/profile/api/employmenthistory");

            _accounting     = _industriesQuery.GetIndustry("Accounting");
            _administration = _industriesQuery.GetIndustry("Administration");
        }
Ejemplo n.º 2
0
        public void TestIndustriesComplete()
        {
            var member = CreateMember();

            UpdateCandidate(member.Id, c => c.Industries = new List <Industry> {
                _industriesQuery.GetIndustry(Industry)
            });
            AssertStatus(member, 30, MemberItem.Industries, MemberItem.Name, MemberItem.EmailAddress, MemberItem.Address, MemberItem.Status);
        }
Ejemplo n.º 3
0
        public void TestUpdateIndustries()
        {
            var industry = _industriesQuery.GetIndustry("Administration");
            var criteria = new MemberSearchCriteria {
                IndustryIds = new[] { industry.Id }
            };

            Test(criteria, () => Select(industry));
        }
Ejemplo n.º 4
0
        public void TestIndustriesComplete()
        {
            var member    = new Member();
            var candidate = new Candidate {
                Industries = new List <Industry> {
                    _industriesQuery.GetIndustry(Industry)
                }
            };

            AssertStatus(member, candidate, null, 5, MemberItem.Industries);
        }
Ejemplo n.º 5
0
        public void EmployerNewJobAdTestsInitialize()
        {
            Resolve <IDbConnectionFactory>().DeleteAllTestData();

            _previewButton = new HtmlButtonTester(Browser, "preview");
            _saveButton    = new HtmlButtonTester(Browser, "save");

            _publishButton = new HtmlButtonTester(Browser, "publish");
            _reopenButton  = new HtmlButtonTester(Browser, "reopen");
            _repostButton  = new HtmlButtonTester(Browser, "repost");
            _editButton    = new HtmlButtonTester(Browser, "edit");

            _titleTextBox                   = new HtmlTextBoxTester(Browser, "Title");
            _positionTitleTextBox           = new HtmlTextBoxTester(Browser, "PositionTitle");
            _externalReferenceIdTextBox     = new HtmlTextBoxTester(Browser, "ExternalReferenceId");
            _bulletPoint1TextBox            = new HtmlTextBoxTester(Browser, "BulletPoint1");
            _bulletPoint2TextBox            = new HtmlTextBoxTester(Browser, "BulletPoint2");
            _bulletPoint3TextBox            = new HtmlTextBoxTester(Browser, "BulletPoint3");
            _summaryTextBox                 = new HtmlTextAreaTester(Browser, "Summary");
            _contentTextBox                 = new HtmlTextAreaTester(Browser, "Content");
            _emailAddressTextBox            = new HtmlTextBoxTester(Browser, "EmailAddress");
            _secondaryEmailAddressesTextBox = new HtmlTextBoxTester(Browser, "SecondaryEmailAddresses");
            _phoneNumberTextBox             = new HtmlTextBoxTester(Browser, "PhoneNumber");
            _faxNumberTextBox               = new HtmlTextBoxTester(Browser, "FaxNumber");
            _countryIdDropDownList          = new HtmlDropDownListTester(Browser, "CountryId");
            _locationTextBox                = new HtmlTextBoxTester(Browser, "Location");
            _firstNameTextBox               = new HtmlTextBoxTester(Browser, "FirstName");
            _lastNameTextBox                = new HtmlTextBoxTester(Browser, "LastName");
            _salaryLowerBoundTextBox        = new HtmlTextBoxTester(Browser, "SalaryLowerBound");
            _salaryUpperBoundTextBox        = new HtmlTextBoxTester(Browser, "SalaryUpperBound");
            _packageTextBox                 = new HtmlTextBoxTester(Browser, "Package");
            _companyNameTextBox             = new HtmlTextBoxTester(Browser, "CompanyName");
            _hideCompanyCheckBox            = new HtmlCheckBoxTester(Browser, "HideCompany");
            _residencyRequiredCheckBox      = new HtmlCheckBoxTester(Browser, "ResidencyRequired");
            _industryIdsListBox             = new HtmlListBoxTester(Browser, "IndustryIds");
            _fullTimeCheckBox               = new HtmlCheckBoxTester(Browser, "FullTime");
            _partTimeCheckBox               = new HtmlCheckBoxTester(Browser, "PartTime");
            _contractCheckBox               = new HtmlCheckBoxTester(Browser, "Contract");
            _tempCheckBox                   = new HtmlCheckBoxTester(Browser, "Temp");
            _jobShareCheckBox               = new HtmlCheckBoxTester(Browser, "JobShare");
            _expiryTimeTextBox              = new HtmlTextBoxTester(Browser, "ExpiryTime");
            _hideContactDetailsCheckBox     = new HtmlCheckBoxTester(Browser, "HideContactDetails");

            _baseFeaturePack = new HtmlRadioButtonTester(Browser, "BaseFeaturePack");
            _featurePack1    = new HtmlRadioButtonTester(Browser, "FeaturePack1");
            _featurePack2    = new HtmlRadioButtonTester(Browser, "FeaturePack2");

            _accounting     = _industriesQuery.GetIndustry("Accounting");
            _administration = _industriesQuery.GetIndustry("Administration");
        }
Ejemplo n.º 6
0
        public void TestAdvancedIndustries()
        {
            var id = CreateSavedJobAdSearch(
                "LinkMe.Common.JobBoard.AdvancedJobSearchCriteria",
                new Dictionary <string, string>
            {
                { "Industries", "administration" },
            }
                );
            var jobAdSearchesQuery = CreateJobAdSearchesQuery(false);
            var search             = jobAdSearchesQuery.GetJobAdSearch(id);

            Assert.AreEqual(1, search.Criteria.IndustryIds.Count);
            Assert.AreEqual(_industriesQuery.GetIndustry("Administration").Id, search.Criteria.IndustryIds[0]);
        }
Ejemplo n.º 7
0
        public void TestIndustryJobs()
        {
            // Choose an industry that has a url alias.

            var industry    = _industriesQuery.GetIndustry("Healthcare, Medical & Pharmaceutical");
            var expectedUrl = new ReadOnlyApplicationUrl("~/jobs/-/" + industry.UrlName + "-jobs");

            TestUrl(expectedUrl);
            TestUrls(
                expectedUrl,
                new ReadOnlyApplicationUrl("~/jobs/-/" + industry.UrlName + "-jobs/"),
                new ReadOnlyApplicationUrl("~/jobs/-/" + industry.UrlName),
                new ReadOnlyApplicationUrl("~/jobs/-/" + industry.UrlAliases[0] + "-jobs"),
                new ReadOnlyApplicationUrl("~/jobs/-/" + industry.UrlAliases[0]));
        }
Ejemplo n.º 8
0
        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);
        }
Ejemplo n.º 9
0
        private JobAd CreateJobAd(int index)
        {
            var jobAd = new JobAd
            {
                Id             = Guid.NewGuid(),
                Status         = JobAdStatus.Open,
                Title          = string.Format("Job Ad {0}", index),
                CreatedTime    = DateTime.Now.AddDays(-100),
                JobDescription = new JobDescription
                {
                    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")
                    },
                    Location = new LocationReference(_locationQuery.GetCountrySubdivision(_australia, "QLD")),
                }
            };

            _jobAdsCommand.CreateJobAd(jobAd);

            return(jobAd);
        }
Ejemplo n.º 10
0
        public void TestInitialize()
        {
            _australia = _locationQuery.GetCountry("Australia");

            Resolve <IDbConnectionFactory>().DeleteAllTestData();
            JobAdSearchHost.ClearIndex();

            var employer = _employerAccountsCommand.CreateTestEmployer("jobposter", _organisationsCommand.CreateTestOrganisation("The Job Advertiser"));

            _one                    = employer.CreateTestJobAd("Title one", "The content for the first ad");
            _one.CreatedTime        = DateTime.Now.AddDays(-1); // Just to make sure it's before "two"; we only index days.
            _one.Description.Salary = new Salary {
                LowerBound = 50000, UpperBound = 60000, Rate = SalaryRate.Year, Currency = Currency.AUD
            };
            _jobAdsCommand.CreateJobAd(_one);
            _jobAdsCommand.OpenJobAd(_one);

            _two = employer.CreateTestJobAd("Title two", "Different content for the second ad");
            _locationQuery.ResolvePostalSuburb(_two.Description.Location, _australia, "2000");
            _two.Description.CompanyName = "Really Bad Employers";
            _two.Description.JobTypes    = JobTypes.Contract;
            _two.Description.Industries  = new List <Industry> {
                _industriesQuery.GetIndustry("Other")
            };
            _jobAdsCommand.CreateJobAd(_two);
            _jobAdsCommand.OpenJobAd(_two);
        }
Ejemplo n.º 11
0
        public IndustryFieldHandler(string fieldName, IBooster booster, IIndustriesQuery industriesQuery)
        {
            _fieldName      = fieldName;
            _booster        = booster;
            _allIndustryIds = new HashSet <Guid>(industriesQuery.GetIndustries().Select(i => i.Id));
            var otherIndustry = industriesQuery.GetIndustry("Other");

            _otherIndustryId = otherIndustry == null ? (Guid?)null : otherIndustry.Id;
        }
Ejemplo n.º 12
0
        public void TestCreateFullProfile()
        {
            var userId = Guid.NewGuid();

            var profile = new LinkedInProfile
            {
                Id               = LinkedInId,
                UserId           = userId,
                FirstName        = FirstName,
                LastName         = LastName,
                OrganisationName = OrganisationName,
                Industries       = new[] { _industriesQuery.GetIndustry(Industry) },
                Location         = _locationQuery.ResolveLocation(_locationQuery.GetCountry(Country), Location),
            };

            _linkedInCommand.UpdateProfile(profile);
            AssertProfile(profile, _linkedInQuery.GetProfile(LinkedInId));
            AssertProfile(profile, _linkedInQuery.GetProfile(profile.UserId));
        }
Ejemplo n.º 13
0
        public void TestJobAdsRewrite()
        {
            var region   = _locationQuery.GetRegion(_locationQuery.GetCountry("Australia"), "Melbourne");
            var industry = _industriesQuery.GetIndustry("Accounting");
            var jobAd    = PostJobAd(industry, region);

            // Apply.

            var url = new ReadOnlyApplicationUrl("~/jobads/" + jobAd.Id.ToString("N") + "/apply");

            Get(url);
            AssertUrl(new ReadOnlyApplicationUrl(true, "~/jobs/" + region.UrlName + "/" + industry.UrlName + "/" + jobAd.Title.ToLower() + "/" + jobAd.Id));

            // View.

            url = new ReadOnlyApplicationUrl("~/jobads/" + jobAd.Id);
            Get(url);
            AssertUrl(new ReadOnlyApplicationUrl(true, "~/jobs/" + region.UrlName + "/" + industry.UrlName + "/" + jobAd.Title.ToLower() + "/" + jobAd.Id));
        }
Ejemplo n.º 14
0
        private void ConvertIndustries(ISearchCriteriaIndustries criteriaIndustries)
        {
            // Convert a list of names into a list of ids.

            criteriaIndustries.IndustryIds = null;
            var names = criteriaIndustries.Industries.Split(new[] { "," }, StringSplitOptions.RemoveEmptyEntries);

            var list = new List <Guid>();

            foreach (var name in names)
            {
                // Try the name first.

                var industry = _industriesQuery.GetIndustryByAnyName(name.Trim());
                if (industry != null)
                {
                    list.Add(industry.Id);
                }
                else
                {
                    // Try as a Guid.

                    try
                    {
                        var id = new Guid(name);
                        industry = _industriesQuery.GetIndustry(id);
                        if (industry != null)
                        {
                            list.Add(industry.Id);
                        }
                    }
                    catch (Exception)
                    {
                    }
                }
            }

            if (list.Count > 0)
            {
                criteriaIndustries.IndustryIds = list;
            }
        }
Ejemplo n.º 15
0
        public void TestIndustries()
        {
            var jobAd = new JobAd {
                Description = new JobAdDescription {
                    Industries = null
                }
            };

            Assert.IsNull(_suggestedMembersQuery.GetCriteria(jobAd).KeywordsExpression);

            jobAd = new JobAd {
                Description = new JobAdDescription {
                    Industries = new Industry[0]
                }
            };
            Assert.IsNull(_suggestedMembersQuery.GetCriteria(jobAd).KeywordsExpression);

            jobAd = new JobAd {
                Description = new JobAdDescription {
                    Industries = new[] { _industriesQuery.GetIndustry("Other") }
                }
            };
            Assert.IsNull(_suggestedMembersQuery.GetCriteria(jobAd).KeywordsExpression);

            jobAd = new JobAd
            {
                Description = new JobAdDescription
                {
                    Industries = new[] { _industriesQuery.GetIndustry("Government/Defence") }
                }
            };
            Assert.AreEqual("Government OR Defence", _suggestedMembersQuery.GetCriteria(jobAd).KeywordsExpression.GetUserExpression());

            jobAd = new JobAd
            {
                Description = new JobAdDescription
                {
                    Industries = new[] { _industriesQuery.GetIndustry("I.T. & T"), _industriesQuery.GetIndustry("Accounting") }
                }
            };
            Assert.AreEqual("(IT OR Telecommunications) Accounting", _suggestedMembersQuery.GetCriteria(jobAd).KeywordsExpression.GetUserExpression());
        }
Ejemplo n.º 16
0
        public void TestSimpleSort()
        {
            _australia = _locationQuery.GetCountry("Australia");

            var employer = _employerAccountsCommand.CreateTestEmployer(0, _organisationsCommand.CreateTestOrganisation(0));

            var one = employer.CreateTestJobAd("Title one", "The content for the first ad");

            one.CreatedTime        = DateTime.Now.AddDays(-1); // Just to make sure it's before "two"; we only index days.
            one.Description.Salary = new Salary {
                LowerBound = 50000, UpperBound = 60000, Rate = SalaryRate.Year, Currency = Currency.AUD
            };
            _jobAdsCommand.CreateJobAd(one);
            _jobAdsCommand.OpenJobAd(one);

            var two = employer.CreateTestJobAd("Title two", "Different content for the second ad");

            _locationQuery.ResolvePostalSuburb(two.Description.Location, _australia, "2000");
            two.Description.CompanyName = "Really Bad Employers";
            two.Description.JobTypes    = JobTypes.Contract;
            two.Description.Industries  = new List <Industry> {
                _industriesQuery.GetIndustry("Other")
            };
            _jobAdsCommand.CreateJobAd(two);
            _jobAdsCommand.OpenJobAd(two);

            var member = new Member {
                Id = Guid.NewGuid()
            };
            var flagList = _jobAdFlagListsQuery.GetFlagList(member);

            _memberJobAdListsCommand.AddJobAdToFlagList(member, flagList, one.Id);
            _memberJobAdListsCommand.AddJobAdToFlagList(member, flagList, two.Id);

            // Title only

            var criteria = new JobAdSearchSortCriteria {
                SortOrder = JobAdSortOrder.JobType
            };

            TestSort(member, criteria, one, two);

            // Title and content

            criteria = new JobAdSearchSortCriteria {
                SortOrder = JobAdSortOrder.CreatedTime
            };
            TestSort(member, criteria, two, one);

            // No results

            //criteria = new JobAdSortCriteria { AdTitle = "one", Keywords = "second" };
            //TestSort(criteria);
        }
Ejemplo n.º 17
0
 private JobAd CreateJobAd(JobPoster jobPoster, int index)
 {
     return(CreateJobAd(
                jobPoster,
                index,
                j =>
     {
         j.Description.Location = _locationQuery.ResolveLocation(_locationQuery.GetCountry(Country), Location);
         j.Description.Industries = new[] { _industriesQuery.GetIndustry(IndustryIds[0]) };
     }));
 }
Ejemplo n.º 18
0
 private LinkedInProfile CreateProfile()
 {
     return(new LinkedInProfile
     {
         Id = LinkedInId,
         FirstName = FirstName,
         LastName = LastName,
         OrganisationName = OrganisationName,
         Location = _locationQuery.ResolveLocation(_locationQuery.GetCountry(Country), Location),
         Industries = new[] { _industriesQuery.GetIndustry(Industry) },
     });
 }
Ejemplo n.º 19
0
        private IList <Industry> GetIndustries()
        {
            // Other industries come last.

            var other = _industriesQuery.GetIndustry("Other");

            return((from i in _industriesQuery.GetIndustries()
                    where i.Name != "Other"
                    orderby i.Name
                    select i)
                   .Concat(new[] { other }).ToList());
        }
Ejemplo n.º 20
0
        public void TestIndustryAlias()
        {
            // The use healthcare-medical was causing a server error.

            var employer = CreateEmployer();
            var industry = _industriesQuery.GetIndustry("Healthcare, Medical & Pharmaceutical");

            Assert.AreEqual("healthcare-medical-pharmaceutical", industry.UrlName);
            Assert.AreEqual("healthcare-medical", industry.UrlAliases[0]);
            var location = GetLocation(Location);
            var jobAd    = CreateJobAd(employer, JobTitle, location, industry, GetIntegratorUserId());

            var expectedUrl = GetJobUrl(jobAd.Id, JobTitle, location, industry);

            TestUrl(expectedUrl);
            AssertPageContains(jobAd.Id.ToString());

            // Swap industry alias for industry.

            var url = GetJobUrl(jobAd.Id, JobTitle, location, industry.UrlAliases[0]);

            TestUrl(expectedUrl, url);
            AssertPageContains(jobAd.Id.ToString());

            // Update industry in back to search parameters.

            var backToSearchUrl = GetBackToSearchUrl(GetJobUrl(jobAd.Id), industry.UrlName);

            TestUrl(expectedUrl, backToSearchUrl);
            AssertPageContains(jobAd.Id.ToString());

            backToSearchUrl = GetBackToSearchUrl(GetJobUrl(jobAd.Id), industry.UrlAliases[0]);
            TestUrl(expectedUrl, backToSearchUrl);
            AssertPageContains(jobAd.Id.ToString());

            backToSearchUrl = GetBackToSearchUrl(GetJobAdUrl(jobAd.Id), industry.UrlName);
            TestUrl(expectedUrl, backToSearchUrl);
            AssertPageContains(jobAd.Id.ToString());

            backToSearchUrl = GetBackToSearchUrl(GetJobAdUrl(jobAd.Id), industry.UrlAliases[0]);
            TestUrl(expectedUrl, backToSearchUrl);
            AssertPageContains(jobAd.Id.ToString());

            backToSearchUrl = GetBackToSearchUrl(GetJobAspxUrl(jobAd.Id), industry.UrlName);
            TestUrl(expectedUrl, backToSearchUrl);
            AssertPageContains(jobAd.Id.ToString());

            backToSearchUrl = GetBackToSearchUrl(GetJobAspxUrl(jobAd.Id), industry.UrlAliases[0]);
            TestUrl(expectedUrl, backToSearchUrl);
            AssertPageContains(jobAd.Id.ToString());
        }
Ejemplo n.º 21
0
        private Employer CreateEmployer()
        {
            var location = _locationQuery.ResolveLocation(_locationQuery.GetCountry(Country), Location);

            return(new Employer
            {
                FirstName = "Bob",
                LastName = "Smith",
                EmailAddress = new EmailAddress {
                    Address = "*****@*****.**", IsVerified = true
                },
                Organisation = new Organisation {
                    Name = "LinkMe", Address = new Address {
                        Location = location
                    }
                },
                PhoneNumber = new PhoneNumber {
                    Number = "+612344 567", Type = PhoneNumberType.Work
                },
                SubRole = EmployerSubRole.Employer,
                Industries = new[] { _industriesQuery.GetIndustry("Accounting"), _industriesQuery.GetIndustry("Automotive"), _industriesQuery.GetIndustry("Banking & Financial Services") }
            });
        }
Ejemplo n.º 22
0
        public void TestAdvancedIndustriesName()
        {
            var id = CreateSavedResumeSearch(
                "LinkMe.Common.Managers.Search.AdvancedResumeSearchCriteria",
                new Dictionary <string, string>
            {
                { "Industries", "administration" },
            }
                );
            var memberSearchesQuery = CreateMemberSearchesQuery();
            var search = memberSearchesQuery.GetMemberSearch(id);

            Assert.AreEqual(1, search.Criteria.IndustryIds.Count);
            Assert.AreEqual(_industriesQuery.GetIndustry("Administration").Id, search.Criteria.IndustryIds[0]);
        }
Ejemplo n.º 23
0
        private bool GetValue(SyndicationElementExtension extension, Action <Industry> assign)
        {
            var str = extension.GetObject <string>();

            if (string.IsNullOrEmpty(str))
            {
                return(false);
            }

            var industry = _industriesQuery.GetIndustry(str);

            if (industry == null)
            {
                return(false);
            }

            assign(industry);
            return(true);
        }
Ejemplo n.º 24
0
        IList <Industry> ILinkedInQuery.GetIndustries(string industry)
        {
            if (string.IsNullOrEmpty(industry))
            {
                return(new List <Industry>());
            }

            IList <string> groups;

            if (!_industryGroups.TryGetValue(industry, out groups))
            {
                return(new List <Industry>());
            }

            var names = (from g in groups
                         let n = _groups.ContainsKey(g) ? _groups[g] : null
                                 where n != null
                                 select n).Distinct();

            return((from n in names select _industriesQuery.GetIndustry(n)).ToList());
        }
Ejemplo n.º 25
0
        private void CreateEmployer(IOrganisation organisation, CreateEmployerModel model)
        {
            var employer = new Employer
            {
                Organisation = organisation,
                SubRole      = model.SubRole,
                EmailAddress = new EmailAddress {
                    Address = model.EmailAddress, IsVerified = true
                },
                FirstName   = model.FirstName,
                LastName    = model.LastName,
                JobTitle    = model.JobTitle,
                PhoneNumber = _phoneNumbersQuery.GetPhoneNumber(model.PhoneNumber, ActivityContext.Location.Country),
            };

            if (model.IndustryId != null)
            {
                employer.Industries = new List <Industry> {
                    _industriesQuery.GetIndustry(model.IndustryId.Value)
                }
            }
            ;

            // Create the account, where the password must be changed at next login.

            var credentials = new LoginCredentials
            {
                LoginId            = model.LoginId,
                Password           = model.Password,
                PasswordHash       = LoginCredentials.HashToString(model.Password),
                MustChangePassword = true,
            };

            _employerAccountsCommand.CreateEmployer(employer, credentials);

            var members = _accountReportsQuery.GetUsers(UserType.Member, DateTime.Now);

            _emailsCommand.TrySend(new NewEmployerWelcomeEmail(employer, model.LoginId, model.Password, members));
        }
Ejemplo n.º 26
0
        private JobAd MapJobAd(PostAdvert postAd)
        {
            var workHours = postAd.WorkHoursSpecified? postAd.WorkHours : (WorkHours?)null;
            var pay       = postAd.PayAmountSpecified? postAd.PayAmount : (decimal?)null;
            var payMin    = postAd.PayMinimumSpecified ? postAd.PayMinimum : (decimal?)null;
            var payMax    = postAd.PayMaximumSpecified ? postAd.PayMaximum : (decimal?)null;

            var jobAd = new JobAd
            {
                Integration =
                {
                    IntegratorReferenceId = postAd.JobReference,
                    ExternalReferenceId   = postAd.ClientReference,
                    ExternalApplyUrl      = postAd.RedirectionUrl,
                },
                Title          = postAd.Position,
                ContactDetails = new ContactDetails
                {
                    LastName    = TextUtil.Truncate(postAd.Contact, DomainConstants.PersonNameMaxLength),
                    PhoneNumber = postAd.Telephone,
                    CompanyName = postAd.AdvertiserName,
                },
                Description =
                {
                    Industries        = new List <Industry> {
                        _industriesQuery.GetIndustry(postAd.Classification)
                    },
                    PositionTitle     = (postAd.SubClassification == "Other" ? null : postAd.SubClassification),
                    Content           = postAd.Description,
                    JobTypes          = MapJobTypes(postAd.EmploymentType, workHours),
                    ResidencyRequired = (postAd.VisaRequired == VisaRequired.MustBeEligible),
                    Salary            = MapSalary(postAd.PayPeriod, pay, payMin, payMax),
                    Location          = _locationMapper.Map(postAd.Country, postAd.Location, postAd.Area, postAd.PostCode),
                },
            };

            return(jobAd);
        }
Ejemplo n.º 27
0
        public void TestIndustryAlias()
        {
            // The use healthcare-medical was causing a server error.

            var employer = CreateEmployer();
            var industry = _industriesQuery.GetIndustry("Healthcare, Medical & Pharmaceutical");
            var location = GetLocation(Location);
            var jobAd    = CreateJobAd(employer, JobTitle, location, industry);

            Assert.AreEqual("healthcare-medical", industry.UrlAliases[0]);

            var url = GetJobAdUrl(jobAd.Id).AsNonReadOnly();

            url.QueryString.Add("backToSearchType", "advancedJobSearch");
            url.QueryString.Add("backToResultIndex", "1");
            url.QueryString.Add("Distance", "");
            url.QueryString.Add("SortOrder", "2");
            url.QueryString.Add("Industries", industry.UrlAliases[0]);

            Get(url);
            AssertUrl(new ReadOnlyApplicationUrl(true, "~/jobs/" + location.ToString().Replace(" ", "-").ToLower() + "/" + industry.UrlName + "/" + jobAd.Title.Replace(" ", "-").ToLower() + "/" + jobAd.Id));
            AssertPageContains(jobAd.Id.ToString());
        }
Ejemplo n.º 28
0
        public void TestIndustriesChanged()
        {
            var employer = CreateEmployer(0);

            LogIn(employer);
            Get(_settingsUrl);

            // Try to update.

            var newIndustryIds = new[] { _industriesQuery.GetIndustry("Banking & Financial Services").Id, _industriesQuery.GetIndustry("Hospitality & Tourism").Id };

            SelectIndustryIds(newIndustryIds);
            _saveButton.Click();

            // Assert employer.

            var updatedEmployer = _employersQuery.GetEmployer(employer.Id);

            Assert.IsTrue(newIndustryIds.CollectionEqual(updatedEmployer.Industries.Select(i => i.Id)));

            Get(_settingsUrl);
            Assert.IsTrue(GetSelectedIndustryIds().CollectionEqual(updatedEmployer.Industries.Select(i => i.Id)));
        }
Ejemplo n.º 29
0
        public void TestIndustries()
        {
            var accounting     = _industriesQuery.GetIndustry("Accounting");
            var administration = _industriesQuery.GetIndustry("Administration");
            var other          = _industriesQuery.GetIndustry("Other");

            // Create some job ads.

            var employer = CreateEmployer(0);
            var jobAd0   = PostJobAd(Analyst, 0, employer, accounting);
            var jobAd1   = PostJobAd(Analyst, 1, employer, administration);
            var jobAd2   = PostJobAd(Analyst, 2, employer, other);
            var jobAd3   = PostJobAd(Analyst, 3, employer, accounting, other);
            var jobAd4   = PostJobAd(Analyst, 4, employer);

            // Search.

            Search(Analyst);
            AssertJobAds(jobAd0, jobAd1, jobAd2, jobAd3, jobAd4);

            Search(Analyst, _industriesQuery.GetIndustries().ToArray());
            AssertJobAds(jobAd0, jobAd1, jobAd2, jobAd3, jobAd4);

            Search(Analyst, accounting);
            AssertJobAds(jobAd0, jobAd3);

            Search(Analyst, administration);
            AssertJobAds(jobAd1);

            // Other should return "not specfified" job ads as well.

            Search(Analyst, other);
            AssertJobAds(jobAd2, jobAd3, jobAd4);

            Search(Analyst, accounting, administration);
            AssertJobAds(jobAd0, jobAd1, jobAd3);

            Search(Analyst, other, administration);
            AssertJobAds(jobAd1, jobAd2, jobAd3, jobAd4);
        }
Ejemplo n.º 30
0
 public static void ClassInitialize(TestContext context)
 {
     _accounting  = IndustriesQuery.GetIndustry("Accounting");
     _engineering = IndustriesQuery.GetIndustry("Engineering");
     _other       = IndustriesQuery.GetIndustry("Other");
 }