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()); }
public IHttpActionResult GetFailedJobs(int numResults = 5, int pageNumber = 1) { return(Ok(JobRepository.GetByStatus(JobStatus.Failed, numResults, pageNumber))); }
public IHttpActionResult GetCompleted(int numResults = 5, int pageNumber = 1) { return(Ok(JobRepository.GetByStatus(JobStatus.Completed, numResults, pageNumber))); }