Exemplo n.º 1
0
        private void ReportResults(IntegratorUser integratorUser, IHasId <Guid> jobPoster, Report report)
        {
            const string method = "ReportResults";

            _jobAdIntegrationReportsCommand.CreateJobAdIntegrationEvent(new JobAdImportPostEvent
            {
                Success          = true,
                IntegratorUserId = integratorUser.Id,
                PosterId         = jobPoster.Id,
                JobAds           = report.JobAds,
                Closed           = report.Closed,
                Duplicates       = report.Duplicates,
                Failed           = report.Failed,
                Posted           = report.Posted,
                Updated          = report.Updated,
                Ignored          = report.Ignored,
            });

            var message = string.Format("Processing complete. {0} job ads created, {1} updated,"
                                        + " {2} closed, {3} failed, {4} were ignored as duplicates of those from another source,"
                                        + " {5} were ignored as coming from the ignored source.",
                                        report.Posted, report.Updated, report.Closed, report.Failed, report.Duplicates, report.Ignored);

            _logger.Raise(Event.Information, method, message);
        }
Exemplo n.º 2
0
        PostReport IJobAdPostsManager.PostJobAds(IntegratorUser integratorUser, IEmployer jobPoster, IEmployer integratorJobPoster, IEnumerable <JobAd> jobAds, bool closeAllOtherJobAds)
        {
            // Read the jobads.

            var report = new PostReport();

            // Process them.

            jobPoster = jobPoster ?? integratorJobPoster;

            foreach (var jobAd in jobAds)
            {
                ProcessJobAd(integratorUser.Id, jobPoster, jobAd, report);
            }

            if (!closeAllOtherJobAds)
            {
                return(report);
            }

            var jobAdIds      = _jobAdIntegrationQuery.GetJobAdIds(integratorUser.Id, jobPoster.Id);
            var closeJobAdIds = jobAdIds.Except(report.ProcessedJobAdIds).ToList();

            var closeJobAds = _jobAdsQuery.GetJobAds <JobAd>(closeJobAdIds);

            foreach (var closeJobAd in closeJobAds)
            {
                _jobAdsCommand.CloseJobAd(closeJobAd);
            }
            report.Closed += closeJobAdIds.Count();

            return(report);
        }
Exemplo n.º 3
0
        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));
        }
Exemplo n.º 4
0
        public void TestValidUserWithoutPermissions()
        {
            var ats            = _integrationQuery.GetIntegrationSystem <Ats>(_jobG8Query.GetIntegratorUser().IntegrationSystemId);
            var integratorUser = new IntegratorUser
            {
                LoginId             = "JobAdFeedTestUser",
                PasswordHash        = LoginCredentials.HashToString(Password),
                Permissions         = IntegratorPermissions.GetJobApplication,
                IntegrationSystemId = ats.Id,
            };

            _integrationCommand.CreateIntegratorUser(integratorUser);

            var request = new PostAdvertRequestMessage
            {
                UserCredentials = new Credentials
                {
                    Username = "******",
                    Password = Password
                }
            };

            var employer = CreateEmployer(0);

            PostAdvert(employer, request);
        }
Exemplo n.º 5
0
        private void CheckUser(Credentials credentials, out IntegratorUser integratorUser, out IEmployer jobPoster)
        {
            const string method = "CheckUser";

            try
            {
                if (credentials == null)
                {
                    throw new ServiceEndUserException("UserCredentials are not specified.");
                }

                integratorUser = _serviceAuthenticationManager.AuthenticateRequest(credentials.Username, credentials.Password, IntegratorPermissions.PostJobAds);

                jobPoster = GetJobPoster(_jobPosterUserId);
            }
            catch (ServiceEndUserException e)
            {
                var ex = new FaultException(e.Message);
                EventSource.Raise(Event.Error, method, ex, null);
                throw ex;
            }
            catch (UserException e)
            {
                var ex = new FaultException(e.Message);
                EventSource.Raise(Event.Error, method, ex, null);
                throw ex;
            }
            catch (Exception e)
            {
                EventSource.Raise(Event.Error, method, e, null);
                throw;
            }
        }
Exemplo n.º 6
0
        private static byte[] GetData(ReadOnlyUrl url, IntegratorUser user, string password)
        {
            var request = (HttpWebRequest)WebRequest.Create(url.AbsoluteUri);

            request.Method        = "GET";
            request.UserAgent     = "Mozilla/4.0 (compatible; MSIE 6.0)";
            request.ContentLength = 0;
            request.Expect        = "";
            request.Timeout       = Debugger.IsAttached ? -1 : 300000;
            request.Headers.Add("X-LinkMeUsername", user.LoginId);
            request.Headers.Add("X-LinkMePassword", password);

            using (var response = (HttpWebResponse)request.GetResponse())
            {
                var responseStream = response.GetResponseStream();
                var stream         = new MemoryStream();
                var buffer         = new byte[65536];
                int read;
                do
                {
                    read = responseStream.Read(buffer, 0, buffer.Length);
                    stream.Write(buffer, 0, read);
                } while (read != 0);
                stream.Seek(0, SeekOrigin.Begin);

                var data = new byte[stream.Length];
                stream.Read(data, 0, (int)stream.Length);
                return(data);
            }
        }
Exemplo n.º 7
0
        protected JobAd PostJobAd(IEmployer employer, IntegratorUser integratorUser, string companyName, string contactCompanyName, bool hideContactDetails, bool hideCompany)
        {
            var jobAd = PostJobAd(employer);

            jobAd.ContactDetails = new ContactDetails
            {
                FirstName               = FirstName,
                LastName                = LastName,
                CompanyName             = contactCompanyName,
                EmailAddress            = EmailAddress,
                FaxNumber               = FaxNumber,
                PhoneNumber             = PhoneNumber,
                SecondaryEmailAddresses = SecondaryEmailAddresses
            };
            jobAd.Description.CompanyName = companyName;

            jobAd.Visibility.HideContactDetails = hideContactDetails;
            jobAd.Visibility.HideCompany        = hideCompany;

            if (integratorUser != null)
            {
                jobAd.Integration.IntegratorUserId = integratorUser.Id;
            }

            _jobAdsCommand.UpdateJobAd(jobAd);
            return(jobAd);
        }
Exemplo n.º 8
0
 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);
 }
Exemplo n.º 9
0
 void IIntegrationRepository.CreateIntegratorUser(IntegratorUser user)
 {
     using (var dc = CreateContext())
     {
         dc.IntegratorUserEntities.InsertOnSubmit(user.Map());
         dc.SubmitChanges();
     }
 }
Exemplo n.º 10
0
        public ActionResult JobAds()
        {
            const string method = "JobAds";

            IntegratorUser user = null;

            try
            {
                // Authenticate.

                user = _serviceAuthenticationManager.AuthenticateRequest(HttpContext, IntegratorPermissions.PostJobAds);

                // Load the request.

                var xmlDoc = new XmlDocument();
                xmlDoc.LoadXml(GetRequestXml());
                var xmlNsMgr = new XmlNamespaceManager(xmlDoc.NameTable);
                xmlNsMgr.AddNamespace(XmlNamespacePrefix, XmlNamespace);
                var xmlNode = xmlDoc.SelectSingleNode("/" + XmlNamespacePrefix + ":PostJobAdsRequest", xmlNsMgr);

                // Extract values.

                var jobPoster           = GetJobPoster(xmlNode, xmlNsMgr);
                var integratorJobPoster = jobPoster == null
                    ? _externalJobAdsQuery.GetJobPoster(user)
                    : null;

                var closeAllOtherJobAds = jobPoster != null && GetCloseAllOtherAds(xmlNode, xmlNsMgr);

                var jobAds = GetJobAds(xmlNode, xmlNsMgr, jobPoster == null ? JobAdStatus.Draft : (JobAdStatus?)null);

                // Process.

                var report = _jobAdPostsManager.PostJobAds(user, jobPoster, integratorJobPoster, jobAds.Where(j => j != null), closeAllOtherJobAds);

                // Record it, including read failures.

                report.Failed += jobAds.Count(j => j == null);
                _jobAdIntegrationReportsCommand.CreateJobAdIntegrationEvent(new JobAdImportPostEvent {
                    Success = true, IntegratorUserId = user.Id, PosterId = (jobPoster ?? integratorJobPoster).Id, JobAds = jobAds.Count(j => j != null), Closed = report.Closed, Failed = report.Failed, Posted = report.Posted, Updated = report.Updated
                });

                return(Xml(new PostJobAdsResponse(GetResponseXml(report), report.Errors.ToArray())));
            }
            catch (Exception ex)
            {
                EventSource.Raise(ex.Message.EndsWith("disabled.") ? (Event)Event.NonCriticalError : Event.Error, method, "Cannot process the request.", ex, new StandardErrorHandler());

                if (user != null)
                {
                    _jobAdIntegrationReportsCommand.CreateJobAdIntegrationEvent(new JobAdImportPostEvent {
                        Success = false, IntegratorUserId = user.Id
                    });
                }

                return(Xml(new PostJobAdsResponse(ex)));
            }
        }
Exemplo n.º 11
0
        private JobAd PostJobAd(IEmployer jobPoster, IntegratorUser integratorUser)
        {
            var jobAd = jobPoster.CreateTestJobAd();

            jobAd.Integration.IntegratorUserId = integratorUser.Id;
            jobAd.Integration.ExternalApplyUrl = "http://test.external/ad";
            _jobAdsCommand.PostJobAd(jobAd);
            return(jobAd);
        }
Exemplo n.º 12
0
        protected JobAd CreateJobAd(IEmployer employer, IntegratorUser integratorUser)
        {
            var jobAd = base.CreateJobAd(employer);

            jobAd.Integration.ExternalApplyUrl = "http://www.google.com.au/";
            jobAd.Integration.IntegratorUserId = integratorUser.Id;
            _jobAdsCommand.UpdateJobAd(jobAd);
            return(jobAd);
        }
Exemplo n.º 13
0
        private void TestLocation(IntegratorUser integratorUser, Employer jobPoster, int index, string location, string expected)
        {
            var jobAd = CreateJobAd(index, j => { j.Location = location; j.Postcode = null; });

            PostJobAds(integratorUser, jobPoster, false, new[] { jobAd }, 1, 0, 0, 0);
            var found = AssertJobAd(integratorUser, jobPoster.Id, jobAd.ExternalReferenceId, JobAdStatus.Open);

            AssertJobAd(jobAd, found);
            TestLocation(found.Id, expected);
        }
Exemplo n.º 14
0
        private Guid CreateJobAd(IntegratorUser integratorUser, Guid employerId, JobAdElement jobAdElement)
        {
            var jobAd = jobAdElement.Map(_industriesQuery, _locationQuery);

            jobAd.PosterId = employerId;
            jobAd.Integration.IntegratorUserId = integratorUser.Id;
            _jobAdsCommand.CreateJobAd(jobAd);
            _jobAdsCommand.OpenJobAd(jobAd);
            return(jobAd.Id);
        }
Exemplo n.º 15
0
        private string Post(ReadOnlyUrl url, IntegratorUser user, string password, string requestXml)
        {
            Browser.RequestHeaders = new WebHeaderCollection
            {
                { "X-LinkMeUsername", user.LoginId },
                { "X-LinkMePassword", password }
            };

            return(Post(url, "text/xml", requestXml));
        }
Exemplo n.º 16
0
 public static IntegratorUserEntity Map(this IntegratorUser user)
 {
     return(new IntegratorUserEntity
     {
         id = user.Id,
         username = user.LoginId,
         password = user.PasswordHash,
         integratorId = user.IntegrationSystemId,
         permissions = (short)user.Permissions,
     });
 }
Exemplo n.º 17
0
 public JobAdExporter(IChannelManager <IPublicVacancy> channelManager, IDewrQuery dewrQuery, IJobAdsQuery jobAdsQuery, IJobAdExportCommand exportCommand, IIndustriesQuery industriesQuery, IEmployersQuery employersQuery, IIntegrationQuery integrationQuery, IJobAdIntegrationReportsCommand jobAdIntegrationReportsCommand)
 {
     _channelManager   = channelManager;
     _jobAdsQuery      = jobAdsQuery;
     _integrationQuery = integrationQuery;
     _exportCommand    = exportCommand;
     _employersQuery   = employersQuery;
     _jobAdIntegrationReportsCommand = jobAdIntegrationReportsCommand;
     _mapper         = new JobAdMapper(industriesQuery);
     _integratorUser = dewrQuery.GetIntegratorUser();
 }
Exemplo n.º 18
0
        private void AssertJobAds(IntegratorUser integratorUser, Guid employerId, params JobAdElement[] expectedJobAds)
        {
            var jobAds = _jobAdsQuery.GetJobAds <JobAd>(_jobAdIntegrationQuery.GetJobAdIds(integratorUser.Id, employerId));

            Assert.AreEqual(expectedJobAds.Length, jobAds.Count);

            foreach (var expectedJobAd in expectedJobAds)
            {
                AssertJobAd(integratorUser, JobAdStatus.Open, expectedJobAd, jobAds);
            }
        }
Exemplo n.º 19
0
        public JobAdPosterTask(IChannelManager <ISyndicate> channelManager, IHrCareersQuery hrCareersQuery, ILocationQuery locationQuery, IExecuteJobAdSearchCommand jobAdSearch, IIntegrationQuery integrationQuery, IJobAdIntegrationReportsCommand jobAdIntegrationReportsCommand, IWebSiteQuery webSiteQuery, IJobAdsQuery jobAdsQuery)
            : base(Logger)
        {
            _serviceManager   = channelManager;
            _jobAdsQuery      = jobAdsQuery;
            _integrationQuery = integrationQuery;
            _jobAdIntegrationReportsCommand = jobAdIntegrationReportsCommand;

            _integratorUser = hrCareersQuery.GetIntegratorUser();
            _searcher       = new HrJobAdSearcher(jobAdSearch);
            _mapper         = new JobAdMapper(locationQuery, webSiteQuery);
        }
Exemplo n.º 20
0
        public async Task <IdentityResult> InsertUserAsync(IntegratorUser NewUser, string password)
        {
            IdentityResult CreatedSuccessfully;

            using (var serviceScope = _serviceProvider.GetRequiredService <IServiceScopeFactory>().CreateScope())
            {
                var _userManager = serviceScope.ServiceProvider.GetService <UserManager <IntegratorUser> >();
                var success      = await _userManager.CreateAsync(NewUser, password);

                CreatedSuccessfully = success;
            }
            return(CreatedSuccessfully);// _userManager.Create(NewUser, password); ;
        }
Exemplo n.º 21
0
        public ActionResult CloseJobAds()
        {
            const string method = "CloseJobAds";

            IntegratorUser user = null;

            try
            {
                // Authenticate.

                user = _serviceAuthenticationManager.AuthenticateRequest(HttpContext, IntegratorPermissions.PostJobAds);

                // Load the request.

                var xmlDoc = new XmlDocument();
                xmlDoc.LoadXml(GetRequestXml());
                var xmlNsMgr = new XmlNamespaceManager(xmlDoc.NameTable);
                xmlNsMgr.AddNamespace(XmlNamespacePrefix, XmlNamespace);
                var xmlNode = xmlDoc.SelectSingleNode("/" + XmlNamespacePrefix + ":CloseJobAdsRequest", xmlNsMgr);

                // Extract values.

                var jobPoster            = GetJobPoster(xmlNode, xmlNsMgr);
                var externalReferenceIds = GetExternalReferenceIds(xmlNode, xmlNsMgr);

                // Close.

                var report = _jobAdPostsManager.CloseJobAds(user.Id, jobPoster, externalReferenceIds);

                // Record it, including read failures.

                _jobAdIntegrationReportsCommand.CreateJobAdIntegrationEvent(new JobAdImportCloseEvent {
                    IntegratorUserId = user.Id, Success = true, JobAds = externalReferenceIds.Count, Closed = report.Closed, Failed = report.Failed
                });

                return(Xml(new CloseJobAdsResponse(GetResponseXml(report), report.Errors.ToArray())));
            }
            catch (Exception ex)
            {
                EventSource.Raise(ex.Message.EndsWith("disabled.") ? (Event)Event.NonCriticalError : Event.Error, method, "Cannot process the request.", ex, new StandardErrorHandler());

                if (user != null)
                {
                    _jobAdIntegrationReportsCommand.CreateJobAdIntegrationEvent(new JobAdImportCloseEvent {
                        IntegratorUserId = user.Id, Success = false
                    });
                }

                return(Xml(new CloseJobAdsResponse(ex)));
            }
        }
Exemplo n.º 22
0
        protected void PostJobAdsFailure(IntegratorUser integratorUser, Employer jobPoster, bool closeAllOtherAds, IEnumerable <JobAdElement> jobAds, params string[] errorSubStrings)
        {
            // Create request.

            var requestXml = CreatePostRequestXml(jobPoster, closeAllOtherAds, jobAds);

            // Invoke.

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

            // Assert.

            AssertFailure(responseXml, "PostJobAdsResponse", errorSubStrings);
        }
Exemplo n.º 23
0
        private static readonly Encoding Encoding = Encoding.GetEncoding(28591); // Latin-1

        protected static string Get(ReadOnlyUrl url, IntegratorUser user, string password, bool useHeaders)
        {
            if (!useHeaders)
            {
                var newUrl = url.AsNonReadOnly();
                newUrl.QueryString["LinkMeUsername"] = user.LoginId;
                newUrl.QueryString["LinkMePassword"] = password;
                url = newUrl;
            }

            var request = (HttpWebRequest)WebRequest.Create(url.AbsoluteUri);

            request.Method        = "GET";
            request.UserAgent     = "Mozilla/4.0 (compatible; MSIE 6.0)";
            request.ContentLength = 0;
            request.Expect        = "";
            request.Timeout       = Debugger.IsAttached ? -1 : 300000;

            if (useHeaders)
            {
                request.Headers.Add("X-LinkMeUsername", user.LoginId);
                request.Headers.Add("X-LinkMePassword", password);
            }

            try
            {
                using (var response = (HttpWebResponse)request.GetResponse())
                {
                    var encoding = string.IsNullOrEmpty(response.ContentEncoding) ? Encoding : Encoding.GetEncoding(response.ContentEncoding);
                    using (var reader = new StreamReader(response.GetResponseStream(), encoding))
                    {
                        return(reader.ReadToEnd());
                    }
                }
            }
            catch (WebException e)
            {
                if (e.Response == null)
                {
                    throw;
                }

                if (((HttpWebResponse)e.Response).StatusCode == HttpStatusCode.NotFound)
                {
                    throw new NotFoundException(e.Response.ResponseUri);
                }

                throw;
            }
        }
Exemplo n.º 24
0
        private Employer CreateEmployer(IntegratorUser integratorUser)
        {
            // Create an employer with the same user name as the integrator.

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

            _allocationsCommand.CreateAllocation(new Allocation {
                CreditId = _creditsQuery.GetCredit <JobAdCredit>().Id, InitialQuantity = null, OwnerId = employer.Id
            });
            _allocationsCommand.CreateAllocation(new Allocation {
                CreditId = _creditsQuery.GetCredit <ApplicantCredit>().Id, InitialQuantity = null, OwnerId = employer.Id
            });
            return(employer);
        }
Exemplo n.º 25
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);
        }
Exemplo n.º 26
0
        public static IntegratorUser CreateTestIntegratorUser(this IIntegrationCommand integrationCommand, string loginId, string password, IntegratorPermissions permissions)
        {
            var system = new Ats {
                Name = loginId + " Integration System"
            };

            integrationCommand.CreateIntegrationSystem(system);

            var user = new IntegratorUser {
                LoginId = loginId, PasswordHash = HashToString(password), Permissions = permissions, IntegrationSystemId = system.Id
            };

            integrationCommand.CreateIntegratorUser(user);

            return(user);
        }
Exemplo n.º 27
0
        string IJobAdApplicationsManager.SetApplicationStatuses(IntegratorUser integratorUser, string requestXml, List <string> errors)
        {
            var xmlDoc = new XmlDocument();

            xmlDoc.LoadXml(requestXml);
            var xmlNsMgr = new XmlNamespaceManager(xmlDoc.NameTable);

            xmlNsMgr.AddNamespace(XmlNamespacePrefix, XmlNamespace);
            var xmlNode = xmlDoc.SelectSingleNode("/" + XmlNamespacePrefix + ":SetJobApplicationStatusRequest", xmlNsMgr);

            var applicationIds = GetApplicationIds(xmlNode, xmlNsMgr, errors);

            // Set them.

            return(SetApplicationStatuses(integratorUser, applicationIds, errors));
        }
Exemplo n.º 28
0
        public ActionResult JobAds(string industries, string modifiedSince, string modifiedInLastDays)
        {
            const string method = "JobAds";

            IntegratorUser user = null;

            try
            {
                // Authenticate.

                user = _serviceAuthenticationManager.AuthenticateRequest(HttpContext, IntegratorPermissions.GetJobAds);

                // Attempt to get saved searches for this integrator user. In this context saved searches act as the basis for the feed

                var searches = _jobAdSearchesQuery.GetJobAdSearches(user.Id);

                // Process.

                var industryIds  = GetIndustryIds(industries);
                var modifiedDate = GetModifiedSince(modifiedSince, modifiedInLastDays);

                var jobAds = (searches != null && searches.Count > 0)
                    ? _jobAdFeedsManager.GetJobAdFeed(from s in searches select s.Criteria, industryIds, modifiedDate)
                    : _jobAdFeedsManager.GetJobAdFeed(industryIds, modifiedDate);

                // Record it.

                _jobAdIntegrationReportsCommand.CreateJobAdIntegrationEvent(new JobAdExportFeedEvent {
                    IntegratorUserId = user.Id, Success = true, JobAds = jobAds.Count
                });

                return(Xml(new JobAdsResponse(GetResponseXml(jobAds))));
            }
            catch (Exception ex)
            {
                EventSource.Raise(Event.Error, method, "Cannot process the request.", ex, new StandardErrorHandler());

                if (user != null)
                {
                    _jobAdIntegrationReportsCommand.CreateJobAdIntegrationEvent(new JobAdExportFeedEvent {
                        IntegratorUserId = user.Id, Success = false, JobAds = 0
                    });
                }

                return(Xml(new JobAdsResponse(ex)));
            }
        }
Exemplo n.º 29
0
        private async Task LoadSharedKeyAndQrCodeUriAsync(IntegratorUser user)
        {
            // Load the authenticator key & QR code URI to display on the form
            var unformattedKey = await _userManager.GetAuthenticatorKeyAsync(user);

            if (string.IsNullOrEmpty(unformattedKey))
            {
                await _userManager.ResetAuthenticatorKeyAsync(user);

                unformattedKey = await _userManager.GetAuthenticatorKeyAsync(user);
            }

            SharedKey = FormatKey(unformattedKey);

            var email = await _userManager.GetEmailAsync(user);

            AuthenticatorUri = GenerateQrCodeUri(email, unformattedKey);
        }
Exemplo n.º 30
0
        protected override void SetUp()
        {
            base.SetUp();

            ClearSearchIndexes();
            _integratorUser = _integrationCommand.CreateTestIntegratorUser();

            const string testUserId = "employer";

            _employer = _employersCommand.CreateTestEmployer(testUserId, _organisationsCommand.CreateTestOrganisation(0));

            _jobAd = _employer.CreateTestJobAd();
            _jobAd.JobDescription.Summary = "Summary";
            _jobAd.Status = JobAdStatus.Open;
            _jobAd.JobDescription.Industries.Clear();
            _jobAd.JobDescription.Industries.Add(Container.Current.Resolve <IIndustriesCommand>().GetIndustries()[0]);
            _jobAdsCommand.PostJobAd(_jobAd);
        }