Ejemplo n.º 1
0
        public void TestAddress()
        {
            // Create organisation.

            var organisation = new Organisation
            {
                Name    = OrganisationName,
                Address = new Address {
                    Location = _locationQuery.ResolveLocation(_locationQuery.GetCountry(Country), Location)
                },
            };

            _organisationsCommand.CreateOrganisation(organisation);
            AssertOrganisation(organisation, _organisationsQuery.GetOrganisation(organisation.Id));

            // Create employers.

            var employer = new Employer
            {
                EmailAddress = new EmailAddress {
                    Address = EmailAddress, IsVerified = true
                },
                FirstName   = FirstName,
                LastName    = LastName,
                PhoneNumber = new PhoneNumber {
                    Number = PhoneNumber
                },
                Organisation = organisation,
            };

            _employersCommand.CreateEmployer(employer);

            AssertOrganisation(organisation, _employersQuery.GetEmployer(employer.Id).Organisation);
        }
Ejemplo n.º 2
0
        private void CreateEmployer(Employer employer)
        {
            // Set some defaults.

            employer.IsEnabled   = true;
            employer.IsActivated = true;

            // Always make sure the email is verified when created.

            if (employer.EmailAddress != null)
            {
                employer.EmailAddress.IsVerified = true;
            }

            // Always make sure the phone number is a work phone number.

            if (employer.PhoneNumber != null)
            {
                employer.PhoneNumber.Type = PhoneNumberType.Work;
            }

            // Save.

            _employersCommand.CreateEmployer(employer);

            // Create a job poster for this account.

            var poster = new JobPoster {
                Id = employer.Id, SendSuggestedCandidates = false, ShowSuggestedCandidates = true
            };

            _jobPostersCommand.CreateJobPoster(poster);
        }
Ejemplo n.º 3
0
        private static Employer CreateTestEmployer(this IEmployersCommand employersCommand, string emailAddress, string firstName, string lastName, EmployerSubRole subRole, IOrganisation organisation)
        {
            var employer = new Employer
            {
                IsEnabled    = true,
                IsActivated  = true,
                EmailAddress = new EmailAddress {
                    Address = emailAddress, IsVerified = true
                },
                PhoneNumber = new PhoneNumber {
                    Number = DefaultPhoneNumber, Type = PhoneNumberType.Work
                },
                FirstName    = firstName,
                LastName     = lastName,
                Organisation = organisation,
                SubRole      = subRole,
            };

            employersCommand.CreateEmployer(employer);
            return(employer);
        }