Ejemplo n.º 1
0
        public void SubmitTest()
        {
            BenchmarkSystem target = BenchmarkSystem.instance;
            Job             job    = new Job("Submit test", null, 1, 1);

            target.Submit(job);
            Assert.IsTrue(target.Contains(job));
        }
Ejemplo n.º 2
0
        public void RemoveTest()
        {
            BenchmarkSystem target = BenchmarkSystem.instance;
            Job             job    = new Job("Remove test 1", owner, 3, 767);
            Job             job2   = new Job("Remove test 2", owner, 4, 2);

            target.Submit(job);
            target.Submit(job2);
            target.Remove(job);
            Assert.IsTrue(!target.Contains(job));
        }
Ejemplo n.º 3
0
        public void ContainsTest()
        {
            BenchmarkSystem target = BenchmarkSystem.instance;

            // Add jobs and assert
            uint max = 10;

            Job[] jobs = new Job[max];
            for (uint i = 1; i <= max; i++)
            {
                Job job = new Job("Contains test " + i, null, 1, i);
                jobs[i - 1] = job;
                target.Submit(job);
                Assert.IsTrue(target.Contains(job));
            }
            // Remove jobs and assert
            for (uint i = max - 1; i > 0; i--)
            {
                target.Remove(jobs[i]);
                Assert.IsFalse(target.Contains(jobs[i]));
            }
        }