예제 #1
0
 public void Test_RemoveJobNoTInScheduler()
 {
     Scheduler s = new Scheduler();
     Func<string[], int> funk = st => 10;
     Job phonyJob = new Job(new User("test", ""), 50, 5, funk);
     try
     {
         s.RemoveJob(phonyJob);
         Assert.Fail("It was possible to remove a job not in the scheduler");
     }
     catch (ArgumentException)
     {
         // This is good
     }
 }
예제 #2
0
 public void Test_RemoveJobNull()
 {
     Scheduler s = new Scheduler();
     try
     {
         s.RemoveJob(null);
         Assert.Fail("It was possible to remove a \"null\" job");
     }
     catch (ArgumentNullException)
     {
         // This is good
     }
 }
예제 #3
0
        public void Test_RemoveJobInScheduler()
        {
            Scheduler s = new Scheduler();
            Func<string[], int> funk = st => 10;
            Job job = new Job(new User("test", ""), 20, 5, funk);
            s.AddJob(job);

            // Remove a job in the scheduler
            s.RemoveJob(job);
            Assert.AreEqual(0, s.JobsInSequence.Count);
        }