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); }
public CustomAssert(IRestResponse <JobProfileDetailsAPIResponse> apiResponse, JobProfileContentType jobProfile, AppSettings appSettings) { this.apiResponse = apiResponse; this.jobProfile = jobProfile; this.appSettings = appSettings; }
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, }); }
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", }); }
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, }); }
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, }); }