Esempio n. 1
0
        public void JobManager_JobHitsDifferentStates()
        {
            var currentPending  = JobRepository.GetByStatus(JobStatus.Pending).Count();
            var currentComplete = JobRepository.GetByStatus(JobStatus.Completed).Count();

            JobManager.Pause();
            JobManager.QueueJob(new Models.Job("www.sometest.com"));

            Assert.AreEqual(currentPending + 1, JobRepository.GetByStatus(JobStatus.Pending).Count());

            JobManager.Resume();

            //Wait for it all to be processed.
            Task.Delay(TimeSpan.FromSeconds(1)).Wait();

            Assert.AreEqual(currentComplete + 1, JobRepository.GetByStatus(JobStatus.Completed).Count());
        }
Esempio n. 2
0
 public IHttpActionResult GetFailedJobs(int numResults = 5, int pageNumber = 1)
 {
     return(Ok(JobRepository.GetByStatus(JobStatus.Failed, numResults, pageNumber)));
 }
Esempio n. 3
0
 public IHttpActionResult GetCompleted(int numResults = 5, int pageNumber = 1)
 {
     return(Ok(JobRepository.GetByStatus(JobStatus.Completed, numResults, pageNumber)));
 }