public void GetJobListTest_EmptyString()
        {
            // arrange
            var jobString   = "";
            var expected    = new List <Job>();
            var jobsBuilder = new JobsBuilder();

            // act
            var actual = jobsBuilder.GetJobList(jobString.ToUpper());

            // assert
            CollectionAssert.AreEqual(expected, actual);
        }
Example #2
0
        public List <Job> GetOrderedJobList(string jobsString)
        {
            if (!_stringValidator.IsValidString(jobsString))
            {
                throw new Exception("Error: wrong syntax");
            }

            var jobs = _jobsBuilder.GetJobList(jobsString);

            if (!_jobsValidator.IsValidListOfJobs(jobs))
            {
                throw new Exception("Error: the job list is not coherent");
            }

            return(_sortAlgorithm.Sort(jobs));
        }
        public void GetJobListTest_SimpleJob()
        {
            // arrange
            var jobString = "a";
            var expected  = new List <Job>
            {
                jobA
            };
            var jobsBuilder = new JobsBuilder();

            // act
            var actual = jobsBuilder.GetJobList(jobString.ToUpper());

            // assert
            CollectionAssert.AreEqual(expected, actual, new JobsComparerByNameThenByFirstDifferentDependency());
        }