public void Dfc2857RouteEntryViewTests(bool entryReqs, bool moreInfoLinks, RouteEntryType routeEntryType, string subjects, string furtherinformation, string routeRequirement) { // Arrange var restrictionsView = new _MVC_Views_JobProfileHowToBecome_RouteEntry_cshtml(); var routeEntryVm = new RouteEntry { EntryRequirements = GetEntryRequirements(entryReqs), MoreInformationLinks = GetInformationLinks(moreInfoLinks), RouteName = routeEntryType, RouteSubjects = subjects, FurtherRouteInformation = furtherinformation, RouteRequirement = routeRequirement }; // Act var htmlDocument = restrictionsView.RenderAsHtml(routeEntryVm); // Assert if (string.IsNullOrWhiteSpace(subjects) && string.IsNullOrWhiteSpace(furtherinformation) && string.IsNullOrWhiteSpace(routeRequirement) && !entryReqs && !moreInfoLinks) { AssertViewIsEmpty(htmlDocument); } if (!string.IsNullOrWhiteSpace(subjects)) { AssertContentExistsInView(subjects, htmlDocument); } if (!string.IsNullOrWhiteSpace(furtherinformation)) { AssertContentExistsInView(furtherinformation, htmlDocument); } if (!string.IsNullOrWhiteSpace(routeRequirement) && entryReqs) { AssertContentExistsInView(routeRequirement, htmlDocument); } if (entryReqs) { GetItemCountByUlClass("list-reqs", htmlDocument).Should().IsSameOrEqualTo(routeEntryVm.MoreInformationLinks.Count()); } // Assert if (moreInfoLinks) { GetItemCountByUlClass("list-link", htmlDocument).Should().IsSameOrEqualTo(routeEntryVm.MoreInformationLinks.Count()); } }
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, }); }
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 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, }); }