Beispiel #1
0
        public void TestCancel()
        {
            system.Submit(Job1);
            system.Submit(Job2);
            system.Submit(Job3);
            system.Submit(Job4);

            system.Cancel(Job2);

            Job[] Jobs = scheduler.GetJobs();
            Assert.AreEqual("job3", Jobs[0].ToString(), "Job3 did not match");
            Assert.AreEqual("job4", Jobs[1].ToString(), "Job4 did not match");
            Assert.AreEqual("job1", Jobs[2].ToString(), "Job1 did not match");
        }
Beispiel #2
0
        public void TestCancel()
        {
            system.Submit(job1);
            system.Submit(job2);
            system.Submit(job3);
            system.Submit(job4);

            system.Cancel(job2);

            Job[] jobs = scheduler.GetJobs();
            Assert.AreEqual("1,5,Michael", jobs[0].ToString(), "Job3 did not match");
            Assert.AreEqual("6,10,Michael", jobs[1].ToString(), "Job4 did not match");
            Assert.AreEqual("4,40,Michael", jobs[2].ToString(), "Job1 did not match");
        }
        public void TestCancel()
        {
            BenchmarkSystem BS = new BenchmarkSystem();
            Job job = new Job((string[] arg) => { return arg.Length.ToString(); }, new Owner("tester"), 3, 35);

            Assert.AreEqual(0, BS.Status.Count);
            Assert.AreEqual(true, BS.scheduler.Empty());

            BS.Submit(job);
            Assert.AreEqual(1, BS.Status.Count);
            Assert.IsTrue(BS.Status.Contains(job));
            Assert.IsFalse(BS.scheduler.Empty());

            BS.Cancel(job);
            Assert.AreEqual(0, BS.Status.Count);
            Assert.IsFalse(BS.Status.Contains(job));
            Assert.IsTrue(BS.scheduler.Empty());
        }