public async Task HoursPerWeekParsed()
        {
            var lookupValuesProvider = new Mock <IJobsLookupValuesProvider>();
            var splitter             = new Mock <IWorkPatternSplitter>();

            splitter.Setup(x => x.SplitWorkPatterns(It.IsAny <IList <JobsLookupValue> >())).Returns(new List <JobsLookupValue>());
            var parser = new TribePadWorkPatternParser(lookupValuesProvider.Object, splitter.Object);

            var result = await parser.ParseWorkPattern(Properties.Resources.TribePadWorkPatternFullTime);

            Assert.IsNotNull(result);
            Assert.AreEqual(37, result.HoursPerWeek);
        }
        public async Task WorkPatternMissingHoursIndicateFullTimeParsed()
        {
            var lookupValuesProvider = new Mock <IJobsLookupValuesProvider>();
            var splitter             = new Mock <IWorkPatternSplitter>();

            splitter.Setup(x => x.SplitWorkPatterns(It.IsAny <IList <JobsLookupValue> >())).Returns(new List <JobsLookupValue>());
            var parser = new TribePadWorkPatternParser(lookupValuesProvider.Object, splitter.Object);

            var result = await parser.ParseWorkPattern(Properties.Resources.TribePadWorkPatternMissing37Hours);

            Assert.IsNotNull(result);
            Assert.IsTrue(result.WorkPatterns.Contains(WorkPattern.FULL_TIME));
            Assert.IsFalse(result.WorkPatterns.Contains(WorkPattern.PART_TIME));
        }
        public async Task OtherWorkPatternParsed()
        {
            var lookupValuesProvider = new Mock <IJobsLookupValuesProvider>();
            var workPatternList      = new List <JobsLookupValue>()
            {
                new JobsLookupValue()
                {
                    FieldId = "13", LookupValueId = "16", Text = "Other"
                }
            } as IList <JobsLookupValue>;

            lookupValuesProvider.Setup(x => x.ReadWorkPatterns()).Returns(Task.FromResult(workPatternList));
            var splitter = new Mock <IWorkPatternSplitter>();

            splitter.Setup(x => x.SplitWorkPatterns(It.IsAny <IList <JobsLookupValue> >())).Returns(workPatternList);

            var parser = new TribePadWorkPatternParser(lookupValuesProvider.Object, splitter.Object);

            var result = await parser.ParseWorkPattern(Properties.Resources.TribePadWorkPatternFullTime);

            Assert.IsNotNull(result);
            Assert.AreEqual(1, result.WorkPatterns.Count);
            Assert.IsTrue(result.WorkPatterns.Contains("Other"));
        }