public async Task OrganisationParsed() { var lookupValuesProvider = new Mock <IJobsLookupValuesProvider>(); var salaryParser = new Mock <ISalaryParser>(); var workPatternParser = new Mock <IWorkPatternParser>(); var parser = new TribePadJobParser(lookupValuesProvider.Object, salaryParser.Object, workPatternParser.Object, new Uri("https://www.example.org")); var job = await parser.ParseJob(Properties.Resources.TribePadJobXml, "142"); Assert.AreEqual("East Sussex County Council", job.Organisation); }
public async Task DepartmentParsed() { var lookupValuesProvider = new Mock <IJobsLookupValuesProvider>(); var salaryParser = new Mock <ISalaryParser>(); var workPatternParser = new Mock <IWorkPatternParser>(); var parser = new TribePadJobParser(lookupValuesProvider.Object, salaryParser.Object, workPatternParser.Object, new Uri("https://www.example.org")); var job = await parser.ParseJob(Properties.Resources.TribePadJobXml, "142"); Assert.AreEqual("Orbis (BSD)", job.Department); }
public async Task LogoUrlParsed() { var lookupValuesProvider = new Mock <IJobsLookupValuesProvider>(); var salaryParser = new Mock <ISalaryParser>(); var workPatternParser = new Mock <IWorkPatternParser>(); var parser = new TribePadJobParser(lookupValuesProvider.Object, salaryParser.Object, workPatternParser.Object, new Uri("https://www.example.org")); var job = await parser.ParseJob(Properties.Resources.TribePadJobXml, "142"); Assert.AreEqual("https://www.example.org/image.png", job.LogoUrl.ToString()); }
public async Task NumberOfPositionsParsed() { var lookupValuesProvider = new Mock <IJobsLookupValuesProvider>(); var salaryParser = new Mock <ISalaryParser>(); var workPatternParser = new Mock <IWorkPatternParser>(); var parser = new TribePadJobParser(lookupValuesProvider.Object, salaryParser.Object, workPatternParser.Object, new Uri("https://www.example.org")); var parsedJob = await parser.ParseJob(Properties.Resources.TribePadJobXml, "142"); Assert.AreEqual(2, parsedJob.NumberOfPositions); }
public async Task ClosingDateParsed() { var lookupValuesProvider = new Mock <IJobsLookupValuesProvider>(); var salaryParser = new Mock <ISalaryParser>(); var workPatternParser = new Mock <IWorkPatternParser>(); var parser = new TribePadJobParser(lookupValuesProvider.Object, salaryParser.Object, workPatternParser.Object, new Uri("https://www.example.org")); var job = await parser.ParseJob(Properties.Resources.TribePadJobXml, "142"); Assert.AreEqual(new DateTime(2019, 02, 11), job.ClosingDate); }
public async Task JobTypeParsed() { var lookupValuesProvider = new Mock <IJobsLookupValuesProvider>(); var salaryParser = new Mock <ISalaryParser>(); var workPatternParser = new Mock <IWorkPatternParser>(); var parser = new TribePadJobParser(lookupValuesProvider.Object, salaryParser.Object, workPatternParser.Object, new Uri("https://www.example.org")); var job = await parser.ParseJob(Properties.Resources.TribePadJobXml, "142"); Assert.AreEqual("Administration and Clerical", job.JobType); }
public async Task JobReferenceParsed() { var lookupValuesProvider = new Mock <IJobsLookupValuesProvider>(); var salaryParser = new Mock <ISalaryParser>(); var workPatternParser = new Mock <IWorkPatternParser>(); var locationParser = new Mock <ILocationParser>(); var parser = new TribePadJobParser(lookupValuesProvider.Object, salaryParser.Object, workPatternParser.Object, locationParser.Object, new Uri("https://www.example.org")); var job = await parser.ParseJob(Properties.Resources.TribePadJobXml, "142"); Assert.AreEqual("orbis/TP/12/142", job.Reference); }
public async Task JobIdIsAddedToSingleAttachment() { var lookupValuesProvider = new Mock <IJobsLookupValuesProvider>(); var salaryParser = new Mock <ISalaryParser>(); var workPatternParser = new Mock <IWorkPatternParser>(); var locationParser = new Mock <ILocationParser>(); var parser = new TribePadJobParser(lookupValuesProvider.Object, salaryParser.Object, workPatternParser.Object, locationParser.Object, new Uri("https://www.example.org")); var parsedJob = await parser.ParseJob(Properties.Resources.TribePadJobWith1File, "550"); Assert.IsTrue(parsedJob.AdvertHtml.ToHtmlString().Contains("https://recruitment.orbispartnership.co.uk/members/modules/jobV2/fdownload.php?j=ca8c44cac39a5740&f=63f515371f7149b8&job=550")); }
public async Task NoClosingDateParsed() { var lookupValuesProvider = new Mock <IJobsLookupValuesProvider>(); var salaryParser = new Mock <ISalaryParser>(); var workPatternParser = new Mock <IWorkPatternParser>(); var locationParser = new Mock <ILocationParser>(); var parser = new TribePadJobParser(lookupValuesProvider.Object, salaryParser.Object, workPatternParser.Object, locationParser.Object, new Uri("https://www.example.org")); var job = await parser.ParseJob(Properties.Resources.TribePadNoClosingDate, "134"); Assert.IsNull(job.ClosingDate); }
public async Task BusinessUnitSetToPartnershipSetsOrganisationToPartnershipIfOrganisationNotInTitle() { var lookupValuesProvider = new Mock <IJobsLookupValuesProvider>(); var salaryParser = new Mock <ISalaryParser>(); var workPatternParser = new Mock <IWorkPatternParser>(); var parser = new TribePadJobParser(lookupValuesProvider.Object, salaryParser.Object, workPatternParser.Object, new Uri("https://www.example.org")); var parsedJob = await parser.ParseJob(Properties.Resources.TribePadPartnershipJobXmlOrganisationMissing, "142"); Assert.AreEqual(string.Empty, parsedJob.Department); Assert.AreEqual("Partnership", parsedJob.Organisation); }
public async Task ContractTypeParsed() { var lookupValuesProvider = new Mock <IJobsLookupValuesProvider>(); lookupValuesProvider.Setup(x => x.ReadContractTypes()).Returns(Task.FromResult(new List <JobsLookupValue>() { new JobsLookupValue() { LookupValueId = "2", Text = "Permanent" } } as IList <JobsLookupValue>)); var salaryParser = new Mock <ISalaryParser>(); var workPatternParser = new Mock <IWorkPatternParser>(); var parser = new TribePadJobParser(lookupValuesProvider.Object, salaryParser.Object, workPatternParser.Object, new Uri("https://www.example.org")); var job = await parser.ParseJob(Properties.Resources.TribePadJobXml, "142"); Assert.AreEqual("Permanent", job.ContractType); }