コード例 #1
0
        public void executeAll()
        {
            Owner ow = new Owner("Nicolai");
            Scheduler sh = new Scheduler();

            for(int i = 0; i < 30; i++)
            {
                sh.addJob(new Job(1, 200+i, ow, s => "Hello world"));
            }

            for(int i = 0; i < 30; i++)
            {
                sh.addJob(new Job(1, 600+i, ow, s => "Hello world"));
            }

            for (int i = 0; i < 30; i++)
            {
                sh.addJob(new Job(1, 2001 + i, ow, s => "Hello world"));
            }

            sh.executeAll();

            // Sleeps for a second to make sure that all Jobs gets done
            System.Threading.Thread.Sleep(3000);

            Assert.AreEqual(0, sh.JobQueue.Count);

            Assert.AreEqual(0, sh.shortRunningJobs);
            Assert.AreEqual(0, sh.longRunningJobs);
            Assert.AreEqual(0, sh.veryLongRunningJobs);
        }