Example #1
0
        public async Task GetJobsByProcessAndStatusAsyncTest()
        {
            var job = new Job
            {
                AppID     = AppID,
                ProcessID = processID,
                Created   = DateTime.Now,
                Status    = null
            };

            job = await jobDAL.SetJobAsync(job);

            Assert.True(!string.IsNullOrWhiteSpace(job.JobID));

            await jobDAL.SetToRunningAsync(processID, job.JobID);

            var outJobs = await jobDAL.GetJobsByProcessAndStatusAsync(processID, JobStatus.Running);

            await jobDAL.SetToStoppedAsync(new List <string> {
                job.JobID
            });

            await jobDAL.DeleteAsync(new List <string> {
                job.JobID
            });

            var jobIDs = outJobs.Select(j => j.JobID).ToList();

            Assert.True(jobIDs.Contains(job.JobID));
        }