public void TestInvalidJobDepencencies()
        {
            var jobsToProcess = "a,b,cc";
            JobsProcessorLogic jobsProcessorLogic = new JobsProcessorLogic();

            jobsProcessorLogic.ProcessJobs(jobsToProcess);
        }
        public void TestCircularDependencyException()
        {
            var jobsToProcess = "a,bc,cf,da,e,fb";
            JobsProcessorLogic jobsProcessorLogic = new JobsProcessorLogic();

            jobsProcessorLogic.ProcessJobs(jobsToProcess);
        }
        public void TestComplexJobDependecies()
        {
            var jobsToProcess  = "a,bc,cf,da,eb";
            var expectedResult = "afcbde";
            JobsProcessorLogic jobsProcessorLogic = new JobsProcessorLogic();

            var result = jobsProcessorLogic.ProcessJobs(jobsToProcess);

            Assert.AreEqual(expectedResult, result);
        }
        public void TestBasicJobDependencies()
        {
            var jobsToProcess  = "a,bc,c";
            var expectedResult = "acb";
            JobsProcessorLogic jobsProcessorLogic = new JobsProcessorLogic();

            var result = jobsProcessorLogic.ProcessJobs(jobsToProcess);

            Assert.AreEqual(expectedResult, result);
        }
        public void TestUnorderedJobs()
        {
            var jobsToProcess  = "a,b,c";
            var expectedResult = "abc";
            JobsProcessorLogic jobsProcessorLogic = new JobsProcessorLogic();

            var result = jobsProcessorLogic.ProcessJobs(jobsToProcess);

            Assert.AreEqual(expectedResult, result);
        }
        public void TestSingleJob()
        {
            var jobsToProcess  = "a";
            var expectedResult = "a";
            JobsProcessorLogic jobsProcessorLogic = new JobsProcessorLogic();

            var result = jobsProcessorLogic.ProcessJobs(jobsToProcess);

            Assert.AreEqual(expectedResult, result);
        }
        public void TestEmptyJob()
        {
            var jobsToProcess  = string.Empty;
            var expectedResult = string.Empty;
            JobsProcessorLogic jobsProcessorLogic = new JobsProcessorLogic();

            var result = jobsProcessorLogic.ProcessJobs(jobsToProcess);

            Assert.AreEqual(expectedResult, result);
        }
예제 #8
0
        static void Main(string[] args)
        {
            JobsProcessorLogic jobsProcessorLogic = new JobsProcessorLogic();

            Console.WriteLine("Type in some jobs!");
            string jobs = Console.ReadLine();

            Console.WriteLine("Here's the result sorted by hierarchy:");
            Console.WriteLine(jobsProcessorLogic.ProcessJobs(jobs));
            Console.ReadKey();
        }