Пример #1
0
        private void FillJoin(Employer employer, bool acceptTermsofUse, string password, string passwordConfirmation, string organisationName, string location)
        {
            // Login details.

            _loginIdTextBox.Text         = employer.GetLoginId();
            _passwordTextBox.Text        = password;
            _confirmPasswordTextBox.Text = passwordConfirmation;

            // Contact details.

            _emailAddressTextBox.Text = employer.EmailAddress.Address;
            _firstNameTextBox.Text    = employer.FirstName;
            _lastNameTextBox.Text     = employer.LastName;
            _phoneNumberTextBox.Text  = employer.PhoneNumber.Number;

            // Company details.

            _organisationNameTextBox.Text      = organisationName;
            _locationTextBox.Text              = location;
            _roleRadioButton.IsChecked         = employer.SubRole == EmployerSubRole.Employer;
            _industryIdsListBox.SelectedValues = new[]
            {
                _industryIdsListBox.Items[0].Value,
                _industryIdsListBox.Items[3].Value,
                _industryIdsListBox.Items[4].Value
            };

            _acceptTermsCheckBox.IsChecked = acceptTermsofUse;
        }
Пример #2
0
 protected AmendAdvertRequest CreateRequest(Employer employer, PostAdvertRequest request, string position)
 {
     return(new AmendAdvertRequest
     {
         Adverts = new AmendAdvertRequestAdverts
         {
             AccountNumber = employer.GetLoginId(),
             AmendAdvert = new[]
             {
                 new AmendAdvertRequestAdvertsAmendAdvert
                 {
                     JobReference = request.Adverts.PostAdvert[0].JobReference,
                     Position = position,
                     Description = request.Adverts.PostAdvert[0].Description,
                     Location = request.Adverts.PostAdvert[0].Location,
                     Area = request.Adverts.PostAdvert[0].Area,
                     PostCode = request.Adverts.PostAdvert[0].PostCode,
                     Country = request.Adverts.PostAdvert[0].Country,
                     VisaRequired = (AmendAdvertRequestAdvertsAmendAdvertVisaRequired)request.Adverts.PostAdvert[0].VisaRequired,
                     PayPeriod = (AmendAdvertRequestAdvertsAmendAdvertPayPeriod)request.Adverts.PostAdvert[0].PayPeriod,
                     PayAmount = request.Adverts.PostAdvert[0].PayAmount,
                     PayAmountSpecified = request.Adverts.PostAdvert[0].PayAmountSpecified,
                     Currency = request.Adverts.PostAdvert[0].Currency,
                     Contact = request.Adverts.PostAdvert[0].Contact,
                     EmploymentType = (AmendAdvertRequestAdvertsAmendAdvertEmploymentType)request.Adverts.PostAdvert[0].EmploymentType,
                     WorkHoursSpecified = request.Adverts.PostAdvert[0].WorkHoursSpecified,
                     WorkHours = (AmendAdvertRequestAdvertsAmendAdvertWorkHours)request.Adverts.PostAdvert[0].WorkHours,
                 }
             }
         }
     });
 }
Пример #3
0
 protected PostAdvertRequest CreateRequest(Employer employer, string position)
 {
     return(new PostAdvertRequest
     {
         Adverts = new PostAdvertRequestAdverts
         {
             AccountNumber = employer.GetLoginId(),
             PostAdvert = new[]
             {
                 new PostAdvertRequestAdvertsPostAdvert
                 {
                     JobReference = "RefABCD/1235",
                     ClientReference = "RefABCD",
                     Classification = "Accounting",
                     SubClassification = "Accountant",
                     Position = position,
                     Description = "<p><b><u>Tired of searching for perfect employment? Looking for a fresh start at a new company? </u></b></p>",
                     Location = "Sydney",
                     Area = "Sydney Inner",
                     PostCode = "2000",
                     Country = "Australia",
                     VisaRequired = PostAdvertRequestAdvertsPostAdvertVisaRequired.Applicantsmustbeeligibletoworkinthespecifiedlocation,
                     PayPeriod = PostAdvertRequestAdvertsPostAdvertPayPeriod.Annual,
                     PayAmount = 100000, PayAmountSpecified = true,
                     Currency = "AUS",
                     Contact = "John Bloomfield",
                     EmploymentType = PostAdvertRequestAdvertsPostAdvertEmploymentType.Permanent,
                     WorkHoursSpecified = false,
                     WorkHours = default(PostAdvertRequestAdvertsPostAdvertWorkHours),
                     RedirectionUrl = "http://www.jobg8.com/Redirection.aspx?jbid=52&amp;jid=5384886&amp;email=[[candidateemailaddress]]",
                 }
             }
         }
     });
 }
Пример #4
0
        private static string CreatePostRequestXml(Employer jobPoster, bool closeAllOtherAds, IEnumerable <JobAdElement> ads)
        {
            var writer    = GetXmlStringWriter();
            var xmlWriter = new XmlTextWriter(writer);

            xmlWriter.WriteStartDocument();

            xmlWriter.WriteStartElement("PostJobAdsRequest", WebConstants.WEB_SERVICE_NAMESPACE);
            xmlWriter.WriteAttributeString("version", "1.1");

            xmlWriter.WriteStartElement("JobAds");
            if (jobPoster != null)
            {
                xmlWriter.WriteAttributeString("jobPosterUserId", jobPoster.GetLoginId());
            }
            xmlWriter.WriteAttributeString("closeAllOtherAds", XmlConvert.ToString(closeAllOtherAds));

            foreach (var ad in ads)
            {
                Serializer.Serialize(xmlWriter, ad);
            }

            xmlWriter.WriteEndDocument();
            xmlWriter.Flush();

            return(writer.ToString());
        }
Пример #5
0
        private void AssertEmail(Employer employer, string password)
        {
            var email = _emailServer.AssertEmailSent();

            email.AssertAddresses(Return, Return, employer);
            email.AssertHtmlViewContains("Your login ID: " + employer.GetLoginId());
            email.AssertHtmlViewContains("Your password: " + password);
        }
Пример #6
0
        private void TestLoggedIn(Employer employer, ReadOnlyUrl url)
        {
            // Try to access the page.

            Get(url);
            AssertPath(_loginUrl);

            // Login.

            _loginIdTextBox.Text  = employer.GetLoginId();
            _passwordTextBox.Text = Password;
            _loginButton.Click();
            AssertUrl(url);
        }
Пример #7
0
        protected void CloseJobAds(IntegratorUser integratorUser, Employer jobPoster, IEnumerable <JobAdElement> jobAds, int closed, int failed, params string[] errorSubStrings)
        {
            // Create request.

            var requestXml = CreateCloseRequestXml(jobPoster.GetLoginId(), jobAds);

            // Invoke.

            var responseXml = Post(_closeUrl, integratorUser, Password, requestXml);

            // Assert.

            AssertResponse(responseXml, "CloseJobAdsResponse", -1, -1, closed, failed, errorSubStrings);
        }
Пример #8
0
        private void AssertEmployer(Employer expectedEmployer)
        {
            // Load the employer.

            var id       = _loginCredentialsQuery.GetUserId(expectedEmployer.GetLoginId());
            var employer = _employersQuery.GetEmployer(id.Value);

            // Compare.

            Assert.IsNotNull(employer);
            Assert.AreEqual(expectedEmployer.GetLoginId(), employer.GetLoginId());
            Assert.AreEqual(expectedEmployer.EmailAddress, employer.EmailAddress);
            Assert.AreEqual(expectedEmployer.FirstName, employer.FirstName);
            Assert.AreEqual(expectedEmployer.LastName, employer.LastName);
            Assert.AreEqual(expectedEmployer.SubRole, employer.SubRole);
            foreach (var item in expectedEmployer.Industries)
            {
                Assert.AreEqual(employer.Industries.Contains(_industriesQuery.GetIndustry(item.Id)), true);
            }
            Assert.AreEqual(expectedEmployer.JobTitle, employer.JobTitle);
            Assert.AreEqual(expectedEmployer.PhoneNumber, employer.PhoneNumber);
            Assert.AreEqual(expectedEmployer.Organisation.Name, employer.Organisation.Name);
            Assert.AreEqual(expectedEmployer.Organisation.Address.Location, employer.Organisation.Address.Location);
        }
Пример #9
0
 private static JobFeedReaderTask CreateTask(IntegratorUser integratorUser, Employer jobPoster)
 {
     return(new JobFeedReaderTask(
                Resolve <IJobAdsCommand>(),
                Resolve <IJobAdsQuery>(),
                Resolve <IJobAdIntegrationQuery>(),
                Resolve <IExternalJobAdsCommand>(),
                Resolve <IExternalJobAdsQuery>(),
                Resolve <IJobAdIntegrationReportsCommand>(),
                Resolve <IIntegrationQuery>(),
                Resolve <IIndustriesQuery>(),
                Resolve <ILocationQuery>())
     {
         RemoteUrl = FileSystem.GetAbsolutePath(@"Apps\Services\Test\External\PageUp\LongSummaryFeed.xml", RuntimeEnvironment.GetSourceFolder()),
         IntegratorUserLoginId = integratorUser.LoginId,
         JobPosterLoginId = jobPoster.GetLoginId(),
     });
 }
Пример #10
0
 private PostAdvertRequestMessage CreateRequest(Employer employer, EmploymentType employmentType, WorkHours?workHours)
 {
     return(new PostAdvertRequestMessage
     {
         UserCredentials = new Credentials
         {
             Username = _jobG8Query.GetIntegratorUser().LoginId,
             Password = Password
         },
         PostAdvert = new PostAdvertRequest
         {
             Adverts = new PostAdverts
             {
                 AccountNumber = employer.GetLoginId(),
                 PostAdvert = new[]
                 {
                     new PostAdvert
                     {
                         JobReference = "RefABCD/1235",
                         ClientReference = "RefABCD",
                         Classification = "Accounting",
                         SubClassification = "Accountant",
                         Position = "Chartered Accountant",
                         Description = "<p><b><u>Tired of searching for perfect employment? Looking for a fresh start at a new company? </u></b></p>",
                         Location = "Sydney",
                         Area = "Sydney Inner",
                         PostCode = "2000",
                         Country = "Australia",
                         VisaRequired = VisaRequired.MustBeEligible,
                         PayPeriod = PayPeriod.Annual,
                         PayAmount = 100000, PayAmountSpecified = true,
                         Currency = "AUS",
                         Contact = "John Bloomfield",
                         EmploymentType = employmentType,
                         WorkHoursSpecified = workHours != null,
                         WorkHours = workHours != null ? workHours.Value : default(WorkHours),
                     }
                 }
             }
         }
     });
 }
Пример #11
0
        protected string AmendAdvert(Employer employer, AmendAdvertRequestMessage request)
        {
            IAdvertPostService service = new AdvertPostService(employer.GetLoginId(), _jobAdsCommand, _jobAdsQuery, _jobAdIntegrationQuery, _externalJobAdsCommand, _locationQuery, _industriesQuery, _employersQuery, _loginCredentialsQuery, _serviceAuthenticationManager, _jobAdIntegrationReportsCommand);

            return(service.AmendAdvert(request).AmendAdvertResponse.Success);
        }
Пример #12
0
 private void FillLoginPage(Employer employer)
 {
     _loginIdTextBox.Text          = employer.GetLoginId();
     _passwordTextBox.Text         = Password;
     _rememberMeCheckBox.IsChecked = true;
 }