public void ShouldReturnTrueForExistingSkillGetJobProfileSkillMapping() { var profile = JobProfiles.Where(p => p.Title.EqualsIgnoreCase("Accommodation warden")).ToList(); var result = JobCategorySkillMapper.GetJobProfileMapping(profile, new SkillAttribute { ProfilesWithSkill = new HashSet <string>(StringComparer.InvariantCultureIgnoreCase) { "Accommodation warden" } }); Assert.Single(result, p => p.Included && p.JobProfile == "Accommodation warden"); }
public void CalculatesSkillsCorrectly(string categoryName, string expected) { var result = JobCategorySkillMapper .Map(JobProfiles, JobCategories, 0.75, 0.75) .Where(r => r.JobCategory.EqualsIgnoreCase(categoryName)) .SelectMany(r => r.SkillMappings.Select(s => s.ONetAttribute)); var assertions = expected.Split("|", StringSplitOptions.RemoveEmptyEntries) .Select(s => new Action <string>(sk => Assert.Equal(s, sk.ToLower()))) .ToArray(); Assert.Collection(result, assertions); }
public void CanCalculateSkillsForJobCategory(string categoryName, string expected) { var categoryLookup = JobCategories.ToDictionary(c => c.Id, c => c); var category = JobCategories.First(c => c.Title.EqualsIgnoreCase(categoryName)).Id; var result = JobCategorySkillMapper .CalculateSkillsForJobCategory(JobProfiles, categoryLookup, ProminentSkills, 0.75)[category]; var assertions = expected.Split("|", StringSplitOptions.RemoveEmptyEntries) .Select(s => new Action <SkillAttribute>(sk => Assert.Equal(s, sk.ONetAttribute.ToLower()))) .ToArray(); Assert.Collection(result.SkillAttributes, assertions); }
public async Task RunOnce(ILogger logger) { _logger = logger; _logger.LogInformation($"Started updating job profile skills mapping"); var jobProfiles = await _sitefinity.GetAll <SiteFinityJobProfile>("jobprofiles?$select=Id,Title,JobProfileCategories&$expand=RelatedSkills&$orderby=Title"); var jobCategories = await _sitefinity.GetTaxonomyInstances("Job Profile Category"); var categorySkillMappings = JobCategorySkillMapper.Map(jobProfiles, jobCategories, _appSettings.Value.MaxPercentageOfProfileOccurenceForSkill, _appSettings.Value.MaxPercentageDistributionOfJobProfiles); foreach (var categorySkill in categorySkillMappings) { _logger.LogInformation($"Updating job category skill mapping {categorySkill.JobCategory}"); await CreateJobCategoryQuestionSet(categorySkill); } }
public void CanCalculateSkillsToRemoveByPercentage() { var result = JobCategorySkillMapper.CalculateCommonSkillsToRemoveByPercentage(JobProfiles); Assert.Equal(ProminentSkills, result); }