コード例 #1
0
        public async Task OneTimeSetUp()
        {
            IConfigurationRoot configuration = new ConfigurationBuilder().SetBasePath(Directory.GetCurrentDirectory()).AddJsonFile("appsettings.json", optional: true, reloadOnChange: true).Build();

            this.AppSettings  = configuration.Get <AppSettings>();
            this.CommonAction = new CommonAction();
            this.API          = new RelatedCareersAPI(new RestClientFactory(), new RestRequestFactory(), this.AppSettings);
            var canonicalName = this.CommonAction.RandomString(10).ToUpperInvariant();

            this.JobProfile = this.CommonAction.GetResource <JobProfileContentType>("JobProfileContentType");
            this.JobProfile.JobProfileId  = Guid.NewGuid().ToString();
            this.JobProfile.UrlName       = canonicalName;
            this.JobProfile.CanonicalName = canonicalName;
            JobProfile.RelatedCareersData = new List <RelatedCareersData>()
            {
                CommonAction.GenerateRelatedCareersDataSection()
            };
            var jobProfileMessageBody = this.CommonAction.ConvertObjectToByteArray(this.JobProfile);

            this.ServiceBus = new ServiceBusSupport(new TopicClientFactory(), this.AppSettings);
            var message = new MessageFactory().Create(this.JobProfile.JobProfileId, jobProfileMessageBody, "Published", "JobProfile");

            await this.ServiceBus.SendMessage(message).ConfigureAwait(false);

            await Task.Delay(10000).ConfigureAwait(false);
        }
        public async Task DeleteJobProfile(Topic topic, JobProfileContentType jobProfile)
        {
            JobProfileDeleteMessageBody messageBody = ResourceManager.GetResource <JobProfileDeleteMessageBody>("JobProfileDeleteMessageBody");

            messageBody.JobProfileId = jobProfile.JobProfileId;
            Message deleteMessage = this.CreateServiceBusMessage(jobProfile.JobProfileId, this.ConvertObjectToByteArray(messageBody), EnumLibrary.ContentType.JSON, ActionType.Deleted, CType.JobProfile);
            await topic.SendAsync(deleteMessage).ConfigureAwait(true);
        }
        public JobProfileContentType GenerateJobProfileContentType()
        {
            string canonicalName             = this.RandomString(10);
            JobProfileContentType jobProfile = ResourceManager.GetResource <JobProfileContentType>("JobProfileContentType");

            jobProfile.JobProfileId  = Guid.NewGuid().ToString();
            jobProfile.UrlName       = canonicalName;
            jobProfile.CanonicalName = canonicalName;
            return(jobProfile);
        }
コード例 #4
0
 public CustomAssert(IRestResponse <JobProfileDetailsAPIResponse> apiResponse, JobProfileContentType jobProfile, AppSettings appSettings)
 {
     this.apiResponse = apiResponse;
     this.jobProfile  = jobProfile;
     this.appSettings = appSettings;
 }
コード例 #5
0
        public LinksContentType GenerateLinksContentTypeForJobProfile(RouteEntryType routeEntryType, JobProfileContentType jobProfile)
        {
            RouteEntry routeEntry = jobProfile.HowToBecomeData.RouteEntries.Where(re => re.RouteName.Equals((int)routeEntryType)).FirstOrDefault();

            if (routeEntry == null)
            {
                throw new Exception($"Unable to find the route entry with route name {(int)routeEntryType}");
            }

            return(new LinksContentType()
            {
                Id = routeEntry.MoreInformationLinks[0].Id,
                Text = "This is updated link text",
                Title = "This is an updated link title",
                Url = $"https://{this.RandomString(10)}.com/",
                JobProfileId = jobProfile.JobProfileId,
                JobProfileTitle = jobProfile.Title,
            });
        }
コード例 #6
0
 public RegistrationsContentType GenerateRegistrationsContentTypeForJobProfile(JobProfileContentType jobProfile)
 {
     return(new RegistrationsContentType()
     {
         Id = jobProfile.HowToBecomeData.Registrations[0].Id,
         Info = "This is the upated info for the registrations record",
         JobProfileId = jobProfile.JobProfileId,
         JobProfileTitle = jobProfile.Title,
         Title = "This is the upated title for the registrations record",
     });
 }
コード例 #7
0
 public EntryRequirementsClassification GenerateEntryRequirementsClassificationForJobProfile(RouteEntryType routeEntryType, JobProfileContentType jobProfile)
 {
     return(new EntryRequirementsClassification()
     {
         Id = jobProfile.HowToBecomeData.RouteEntries[(int)routeEntryType].EntryRequirements[0].Id,
         Description = $"This is an updated description for the entry requirement for the {routeEntryType.ToString()} route entry",
         Title = $"This is an updated title for the entry requirement for the {routeEntryType.ToString()} route entry",
         Url = $"https://{this.RandomString(10)}.com/",
         JobProfileId = jobProfile.JobProfileId,
         JobProfileTitle = jobProfile.Title,
     });
 }
コード例 #8
0
        public RequirementContentType GenerateRequirementClassificationForJobProfile(RouteEntryType routeEntryType, JobProfileContentType jobProfile)
        {
            RouteEntry routeEntry = jobProfile.HowToBecomeData.RouteEntries.Where(re => re.RouteName.Equals((int)routeEntryType)).FirstOrDefault();

            if (routeEntry == null)
            {
                throw new Exception($"Unable to find the route entry with route name {(int)routeEntryType}");
            }

            return(new RequirementContentType()
            {
                Id = routeEntry.EntryRequirements[0].Id,
                Info = "This is updated requirement info",
                Title = "This is an updated requirement title",
                JobProfileId = jobProfile.JobProfileId,
                JobProfileTitle = jobProfile.Title,
            });
        }