示例#1
0
        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);
        }
示例#2
0
        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);
        }
示例#3
0
        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());
        }
示例#4
0
        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);
        }
示例#5
0
        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);
        }
示例#6
0
        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&amp;f=63f515371f7149b8&amp;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);
        }
示例#10
0
        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);
        }
示例#11
0
        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);
        }