Пример #1
0
        public void TestJobAds()
        {
            // Refresh whatever may be in the cache.

            var administrator = _administratorAccountsCommand.CreateTestAdministrator(0);

            _featuredCommand.UpdateFeaturedStatistics(GetFeaturedStatistics());
            ClearCache(administrator);

            // No job ads.

            Get(HomeUrl);
            Assert.AreEqual(0, GetJobAds());

            // Post a job ad yesterday.

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

            jobAd.CreatedTime = DateTime.Now.AddDays(-1);
            _jobAdsCommand.CreateJobAd(jobAd);

            // Should not show up until cache is refreshed.

            Get(HomeUrl);
            Assert.AreEqual(0, GetJobAds());

            _featuredCommand.UpdateFeaturedStatistics(GetFeaturedStatistics());
            ClearCache(administrator);
            Get(HomeUrl);
            Assert.AreEqual(1, GetJobAds());

            // Post another job ad.

            jobAd             = employer.CreateTestJobAd();
            jobAd.CreatedTime = DateTime.Now.AddDays(-4);
            _jobAdsCommand.CreateJobAd(jobAd);

            Get(HomeUrl);
            Assert.AreEqual(1, GetJobAds());

            _featuredCommand.UpdateFeaturedStatistics(GetFeaturedStatistics());
            ClearCache(administrator);
            Get(HomeUrl);
            Assert.AreEqual(2, GetJobAds());

            // Post another outside the 7 day timeframe.

            jobAd             = employer.CreateTestJobAd();
            jobAd.CreatedTime = DateTime.Now.AddDays(-14);
            _jobAdsCommand.CreateJobAd(jobAd);

            Get(HomeUrl);
            Assert.AreEqual(2, GetJobAds());

            _featuredCommand.UpdateFeaturedStatistics(GetFeaturedStatistics());
            ClearCache(administrator);
            Get(HomeUrl);
            Assert.AreEqual(2, GetJobAds());
        }
Пример #2
0
        public void TestSuccess()
        {
            var employer = _employerAccountsCommand.CreateTestEmployer(0, _organisationsCommand.CreateTestOrganisation(0));

            AssertJsonSuccess(LogIn(employer));
            AssertJsonSuccess(Deserialize <JsonResponseModel>(Get(_profileUrl)));
        }
        public void TestSetStatus()
        {
            // Post job ad.

            var jobPoster      = _employerAccountsCommand.CreateTestEmployer(0, _organisationsCommand.CreateTestOrganisation(0));
            var integratorUser = _integrationCommand.CreateTestIntegratorUser();
            var jobAd          = PostJobAd(jobPoster, integratorUser);

            // Apply.

            var applicant   = _memberAccountsCommand.CreateTestMember(0);
            var application = new InternalApplication {
                PositionId = jobAd.Id, ApplicantId = applicant.Id
            };

            _jobAdApplicationSubmissionsCommand.CreateApplication(jobAd, application);
            _jobAdApplicationSubmissionsCommand.SubmitApplication(jobAd, application);
            AssertStatus(application.Id, true, ApplicantStatus.New);

            // Set status.

            AssertSuccess(SetJobApplicationsStatus(integratorUser, application), 1, 0);
            AssertStatus(application.Id, false, ApplicantStatus.New);

            // Set status again.

            AssertSuccess(SetJobApplicationsStatus(integratorUser, application), 1, 0);
            AssertStatus(application.Id, false, ApplicantStatus.New);
        }
Пример #4
0
        private void OneEmailTest()
        {
            var administrator = _administratorAccountsCommand.CreateTestAdministrator(1);
            var campaign      = CreateCampaign(administrator);
            var employer      = _employerAccountsCommand.CreateTestEmployer(0, _organisationsCommand.CreateTestOrganisation(0));

            // Login as administrator.

            LogIn(administrator);

            // Send.

            Get(GetEditTemplateUrl(campaign.Id));
            _emailAddressesTextBox.Text = employer.EmailAddress.Address;
            _sendButton.Click();

            // Check.

            var email = _emailServer.AssertEmailSent();

            email.AssertAddresses(Return, Return, new EmailRecipient(employer.EmailAddress.Address, employer.FullName));
            email.AssertSubject(Subject);
            Assert.IsTrue(email.GetHtmlView().Body.Contains(HtmlBody));
            Assert.IsTrue(email.GetPlainTextView().Body.Contains(TextBody));
        }
Пример #5
0
        public void TestResumeSearchActivityXlsCredits()
        {
            var administrator = _administratorAccountsCommand.CreateTestAdministrator(1);
            var organisation  = CreateVerifiedOrganisation(administrator.Id);
            var employer      = _employerAccountsCommand.CreateTestEmployer(1, organisation);
            var member        = _memberAccountsCommand.CreateTestMember(1);

            // Assign some credits.

            _allocationsCommand.CreateAllocation(new Allocation
            {
                CreatedTime     = DateTime.Now.AddDays(-60),
                CreditId        = _creditsQuery.GetCredit <ContactCredit>().Id,
                InitialQuantity = 100,
                OwnerId         = organisation.Id,
            });

            for (var index = 2; index < 20; ++index)
            {
                _employerMemberViewsCommand.AccessMember(_app, employer, _employerMemberViewsQuery.GetProfessionalView(employer, _memberAccountsCommand.CreateTestMember(index)), MemberAccessReason.PhoneNumberViewed);
            }

            _employerMemberViewsCommand.ViewMember(_app, employer, member);
            var report = _employerReportsCommand.CreateReportTemplate <ResumeSearchActivityReport>(organisation.Id);

            TestResults(administrator, organisation, report, ".xls", "application/vnd.ms-excel", _downloadButton);
        }
Пример #6
0
        public void TestGetNewEmployers()
        {
            var employer1 = _employerAccountsCommand.CreateTestEmployer(1, _organisationsCommand.CreateTestOrganisation(0));

            employer1.CreatedTime = DateTime.Now.AddDays(-2);
            _employerAccountsCommand.UpdateEmployer(employer1);

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

            employer2.CreatedTime = DateTime.Now.AddDays(-1);
            _employerAccountsCommand.UpdateEmployer(employer2);

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

            employer3.CreatedTime = DateTime.Now.AddDays(-3);
            _employerAccountsCommand.UpdateEmployer(employer3);

            var recruiter4 = _employerAccountsCommand.CreateTestRecruiter(4, _organisationsCommand.CreateTestOrganisation(0));

            recruiter4.CreatedTime = DateTime.Now.AddDays(-1);
            _employerAccountsCommand.UpdateEmployer(recruiter4);

            var recruiter5 = _employerAccountsCommand.CreateTestRecruiter(5, _organisationsCommand.CreateTestOrganisation(0));

            recruiter5.CreatedTime = DateTime.Now.AddDays(0);
            _employerAccountsCommand.UpdateEmployer(recruiter5);

            var recruiter6 = _employerAccountsCommand.CreateTestRecruiter(6, _organisationsCommand.CreateTestOrganisation(0));

            recruiter6.CreatedTime = DateTime.Now.AddDays(-4);
            _employerAccountsCommand.UpdateEmployer(recruiter6);
        }
Пример #7
0
        public void TestJobSearchAlertEmailLinks()
        {
            var category = _settingsQuery.GetCategory("MemberAlert");

            // Create a job ad.

            var employer = _employerAccountsCommand.CreateTestEmployer(EmployerUserId, _organisationsCommand.CreateTestOrganisation(0));
            var jobAd    = employer.CreateTestJobAd(JobTitle, JobContent);

            _jobAdsCommand.PostJobAd(jobAd);

            // Do a search.

            var member         = _memberAccountsCommand.CreateTestMember(EmailAddress);
            var savedJobSearch = CreateTestSavedJobSearchAlert(member.Id, JobTitle, DateTime.Now.AddDays(-1));

            savedJobSearch = _jobAdSearchesQuery.GetJobAdSearch(savedJobSearch.Id);
            var search = PerformJobSearchUntilYouGetResults(member, savedJobSearch.Criteria, 1);

            Assert.AreEqual(1, search.Results.TotalMatches);

            // Send the email.

            AssertSettings(member, category, Frequency.Daily);

            _emailsCommand.TrySend(new JobSearchAlertEmail(member, search.Results.TotalMatches,
                                                           CreateEmailResults(search.Results, search.Criteria, MaximumResults),
                                                           search.Criteria, savedJobSearch.Id));

            var email = _emailServer.AssertEmailSent();

            AssertUnsubscribeLink(member, category, email.GetHtmlView().GetLinks()[5]);
        }
Пример #8
0
        protected Employer CreateEmployer(int index, bool verified)
        {
            var organisation = verified
                ? _organisationsCommand.CreateTestVerifiedOrganisation(index, null, Guid.NewGuid())
                : _organisationsCommand.CreateTestOrganisation(index);

            return(_employerAccountsCommand.CreateTestEmployer(index, organisation));
        }
Пример #9
0
        public override TemplateEmail GeneratePreview(Community community)
        {
            var member   = _memberAccountsCommand.CreateTestMember(To, community != null ? community.Id : (Guid?)null);
            var employer = _employerAccountsCommand.CreateTestEmployer(FromLoginId, _organisationsCommand.CreateTestOrganisation(0));

            // Send.

            var view = new ProfessionalView(member, null, ProfessionalContactDegree.Contacted, true, false);

            return(new RejectCandidateEmail(view, FromEmailAddress, employer, Subject, Content));
        }
Пример #10
0
        public void TestJobAd()
        {
            var integratorUser = _integrationCommand.CreateTestIntegratorUser();
            var employer = _employerAccountsCommand.CreateTestEmployer(0, _organisationsCommand.CreateTestOrganisation(0));
            var jobAd = PostJobAd(employer);

            // Get.

            var response = JobAdIds(integratorUser);
            Assert.AreEqual(jobAd.Id, GetJobAdId(response));
        }
Пример #11
0
        public void TestCandidateEmailLinks()
        {
            var employer  = _employerAccountsCommand.CreateTestEmployer(0, _organisationsCommand.CreateTestOrganisation(0));
            var member    = _memberAccountsCommand.CreateTestMember(0);
            var candidate = _candidatesQuery.GetCandidate(member.Id);

            _candidateResumesCommand.AddTestResume(candidate);

            // Send an email.

            var view = _employerMemberViewsQuery.GetEmployerMemberView(employer, member);

            _emailsCommand.TrySend(new EmployerContactCandidateConfirmationEmail(null, employer, member.Id, view.GetDisplayText(true), "subject", "content"));

            // Check the email.

            var email = _emailServer.AssertEmailSent();
            var links = email.GetHtmlView().GetLinks();

            Assert.AreEqual(2, links.Count);

            var definition = typeof(EmployerContactCandidateConfirmationEmail).Name;

            AssertLink(definition, GetCandidateUrl(member), links[0]);
            AssertLink(definition, _contactUsUrl, links[1]);

            // Check the tracking pixel.

            var link = email.GetHtmlView().GetImageLinks().Last();

            AssertTrackingLink(link);

            // Check the MyCandidatesResumeEmail

            view = _employerMemberViewsQuery.GetEmployerMemberView(employer, member);
            _emailsCommand.TrySend(new CandidateResumeEmail(employer, view));

            // Check the email.

            email = _emailServer.AssertEmailSent();
            links = email.GetHtmlView().GetLinks();
            Assert.AreEqual(3, links.Count);

            definition = typeof(CandidateResumeEmail).Name;

            AssertLink(definition, GetCandidateUrl(member), links[0]);
            AssertLink(definition, _candidateSearchUrl, links[1]);
            AssertLink(definition, _contactUsUrl, links[2]);

            // Check the tracking pixel.

            link = email.GetHtmlView().GetImageLinks().Last();
            AssertTrackingLink(link);
        }
Пример #12
0
        public void TestNamedSearch()
        {
            var employer = _employerAccountsCommand.CreateTestEmployer(0, _organisationsCommand.CreateTestVerifiedOrganisation(0));

            // Create a named search.

            var search = CreateMemberSearch(employer, 0);

            // Access the page.

            LogIn(employer);
            Get(_searchesUrl);

            AssertPageContains(search.Name);
        }
Пример #13
0
        public void TestInitialize()
        {
            _users = new List <RegisteredUser>();
            Resolve <IDbConnectionFactory>().DeleteAllTestData();

            _users.Add(_memberAccountsCommand.CreateTestMember("*****@*****.**", "password", "John", "Lennon"));
            _users.Add(_memberAccountsCommand.CreateTestMember("*****@*****.**", "password", "John", "Lennon"));
            _users.Add(_memberAccountsCommand.CreateTestMember("*****@*****.**", "password", "John", "Lennon"));

            _users.Add(_employerAccountsCommand.CreateTestEmployer("employer1", _organisationsCommand.CreateTestOrganisation(0)));
            _users.Add(_employerAccountsCommand.CreateTestEmployer("employer2", _organisationsCommand.CreateTestOrganisation(0)));
            _users.Add(_employerAccountsCommand.CreateTestEmployer("employer3", _organisationsCommand.CreateTestOrganisation(0)));

            _users.Add(_administratorAccountsCommand.CreateTestAdministrator("admin1"));
        }
Пример #14
0
        public void TestRedeemerCoupon()
        {
            var employer1 = _employerAccountsCommand.CreateTestEmployer(1, _organisationsCommand.CreateTestOrganisation(1));
            var employer2 = _employerAccountsCommand.CreateTestEmployer(2, _organisationsCommand.CreateTestOrganisation(2));
            var coupon    = CreateCoupon(0, true, null, new[] { employer1.Id }, null);

            AssertJsonError(Coupon(HttpStatusCode.Forbidden, coupon.Code), null, "300", "The coupon code is not valid for your account. Please login as a different user or user another coupon code.");

            LogIn(employer1);
            AssertJsonSuccess(Coupon(coupon.Code));

            LogOut();
            LogIn(employer2);
            AssertJsonError(Coupon(HttpStatusCode.Forbidden, coupon.Code), null, "300", "The coupon code is not valid for your account. Please login as a different user or user another coupon code.");
        }
Пример #15
0
        public void TestEmployer()
        {
            var employer = _employerAccountsCommand.CreateTestEmployer(0, _organisationsCommand.CreateTestOrganisation(0));

            // Log in.

            AssertNotLoggedIn();
            AssertJsonSuccess(ApiLogIn(employer));

            // Assert that the user was directed to the employer home page after login.

            Get(HomeUrl);
            AssertUrl(LoggedInEmployerHomeUrl);
            AssertPageContains(employer.FullName);
        }
        private void PostJobAds()
        {
            var employer = _employerAccountsCommand.CreateTestEmployer(0, _organisationsCommand.CreateTestOrganisation(0));

            // Create jobs in the localities.

            PostJobAds(employer, _australia, MelbourneVic3000);
            PostJobAds(employer, _australia, ArmadaleVic3143);
            PostJobAds(employer, _australia, NorlaneVic3214);
            PostJobAds(employer, _australia, SydneyNsw2000);

            // Create jobs in the regions.

            PostJobAds(employer, _australia, Melbourne);
            PostJobAds(employer, _australia, Sydney);

            // Create jobs in the subdivisions.

            PostJobAds(employer, _australia, Vic);
            PostJobAds(employer, _australia, Nsw);

            // Create jobs in the countries.

            PostJobAds(employer, _australia, "");
            PostJobAds(employer, _newZealand, "");
        }
Пример #17
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);
        }
Пример #18
0
        public void TestEmployer()
        {
            var employer = _employerAccountsCommand.CreateTestEmployer(0, _organisationsCommand.CreateTestOrganisation(0));

            Get(_newPasswordUrl);

            _loginIdTextBox.Text = employer.GetLoginId();
            _sendButton.Click();

            AssertUrl(_newPasswordUrl);
            Assert.IsTrue(_doneButton.IsVisible);
            _doneButton.Click();

            AssertUrl(HomeUrl);
            LogOut();

            var email = _emailServer.AssertEmailSent();

            email.AssertViewContains(MediaTypeNames.Text.Html, employer.GetLoginId());
            email.AssertViewContains(MediaTypeNames.Text.Html, NewPassword);

            LogIn(employer);
            AssertNotLoggedIn();

            LogIn(employer, NewPassword);
            AssertUrlWithoutQuery(_mustChangePasswordUrl);

            // Change password.

            _passwordTextBox.Text           = NewPassword;
            _newPasswordTextBox.Text        = NewNewPassword;
            _confirmNewPasswordTextBox.Text = NewNewPassword;
            _saveButton.Click();
            AssertUrlWithoutQuery(LoggedInEmployerHomeUrl);

            // Check the user login.

            LogOut();
            LogIn(employer);
            AssertNotLoggedIn();

            LogIn(employer, NewPassword);
            AssertNotLoggedIn();

            LogIn(employer, NewNewPassword);
            AssertUrl(LoggedInEmployerHomeUrl);
        }
Пример #19
0
        public void TestUnverifiedOrganisation()
        {
            // Create the organisation and employer.

            var administrator = _administratorAccountsCommand.CreateTestAdministrator(1);
            var organisation  = _organisationsCommand.CreateTestOrganisation(1);
            var employer      = _employerAccountsCommand.CreateTestEmployer(1, organisation);

            // Search for the organisation.

            LogIn(administrator);
            Get(GetEmployersUrl(organisation));

            AssertEmployers(employer);
            Assert.IsFalse(_includeChildOrganisationsCheckBox.IsVisible);
            Assert.IsFalse(_searchButton.IsVisible);
        }
Пример #20
0
        private JobAd PostJobAd(Industry industry, NamedLocation location)
        {
            var employer = _employerAccountsCommand.CreateTestEmployer(UserId, _organisationsCommand.CreateTestOrganisation(0));
            var jobAd    = employer.CreateTestJobAd("Manager", "Blah blah blah", industry, new LocationReference(location));

            _jobAdsCommand.PostJobAd(jobAd);
            return(jobAd);
        }
Пример #21
0
        public void TestProfile()
        {
            var employer = _employerAccountsCommand.CreateTestEmployer(0, _organisationsCommand.CreateTestOrganisation(0));

            var profile = new LinkedInProfile
            {
                Id     = LinkedInId,
                UserId = employer.Id,
            };

            _linkedInCommand.UpdateProfile(profile);

            var result = _linkedInAuthenticationCommand.AuthenticateUser(LinkedInId);

            Assert.AreEqual(AuthenticationStatus.Authenticated, result.Status);
            Assert.AreEqual(employer.Id, result.User.Id);
        }
Пример #22
0
        private Employer CreateEmployer(int index)
        {
            var employer = _employerAccountsCommand.CreateTestEmployer(index, _organisationsCommand.CreateTestOrganisation(0));

            employer.JobTitle = "Archeologist";
            _employerAccountsCommand.UpdateEmployer(employer);
            return(employer);
        }
Пример #23
0
        protected Employer CreateEmployer()
        {
            var employer = _employerAccountsCommand.CreateTestEmployer(EmployerLoginId, _organisationsCommand.CreateTestOrganisation(0));

            _allocationsCommand.CreateAllocation(new Allocation {
                OwnerId = employer.Id, CreditId = _creditsQuery.GetCredit <ContactCredit>().Id, InitialQuantity = 1000
            });
            return(employer);
        }
Пример #24
0
 public static Employer CreateTestRecruiter(this IEmployerAccountsCommand employersCommand, int index, IOrganisation organisation)
 {
     return(employersCommand.CreateTestEmployer(
                string.Format(UserIdFormat, index),
                string.Format(FirstNameFormat, index),
                string.Format(LastNameFormat, index),
                EmployerSubRole.Recruiter,
                organisation));
 }
Пример #25
0
 public static Employer CreateTestRecruiter(this IEmployerAccountsCommand employersCommand, string loginId, IOrganisation organisation)
 {
     return(employersCommand.CreateTestEmployer(
                loginId,
                string.Format(FirstNameFormat, 0),
                string.Format(LastNameFormat, 0),
                EmployerSubRole.Recruiter,
                organisation));
 }
Пример #26
0
        protected Employer CreateEmployer(int index)
        {
            var employer = _employerAccountsCommand.CreateTestEmployer(0, _organisationsCommand.CreateTestOrganisation(0));

            _allocationsCommand.CreateAllocation(new Allocation {
                CreditId = _creditsQuery.GetCredit <ContactCredit>().Id, OwnerId = employer.Id
            });
            return(employer);
        }
Пример #27
0
 public static Employer CreateTestEmployer(this IEmployerAccountsCommand employersCommand, string loginId, string firstName, string lastName, IOrganisation organisation)
 {
     return(employersCommand.CreateTestEmployer(
                loginId,
                firstName,
                lastName,
                EmployerSubRole.Employer,
                organisation));
 }
Пример #28
0
        public void TestEmployer()
        {
            var employer = _employerAccountsCommand.CreateTestEmployer(0, _organisationsCommand.CreateTestOrganisation(0));

            // Assert that the user is not already logged in.

            GetLoginUrl();
            AssertPageDoesNotContain(employer.FullName);

            // Log in.

            SubmitLogIn(employer);

            // Assert that the user was directed to the employer home page after login.

            AssertUrl(LoggedInEmployerHomeUrl);
            AssertPageContains(employer.FullName);
        }
Пример #29
0
        private Employer CreateEmployer(int?credits)
        {
            var employer = _employerAccountsCommand.CreateTestEmployer(0, _organisationsCommand.CreateTestOrganisation(0));

            _allocationsCommand.CreateAllocation(new Allocation {
                CreditId = _creditsQuery.GetCredit <ContactCredit>().Id, OwnerId = employer.Id, InitialQuantity = credits
            });
            return(employer);
        }
Пример #30
0
        public void TestSearchWithNoCriteria()
        {
            // Create some employers.

            var administrator = _administratorAccountsCommand.CreateTestAdministrator(1);
            var organisation  = _organisationsCommand.CreateTestVerifiedOrganisation(1, null, administrator.Id);

            for (var index = 0; index < 3; ++index)
            {
                _employerAccountsCommand.CreateTestEmployer(index, organisation);
            }

            LogIn(administrator);

            Get(GetSearchEmployersUrl());
            _searchButton.Click();

            AssertResults(3);
        }