Пример #1
0
        public async Task ClaimJobsToRunAsyncByMaxNumTest()
        {
            var job = new Job
            {
                AppID     = AppID,
                Created   = DateTime.Now,
                Status    = null,
                ProcessID = null
            };

            job = jobDAL.SetJob(job);
            Assert.True(!string.IsNullOrWhiteSpace(job.JobID));

            var jobs = await jobDAL.ClaimJobsToRunAsync(processID, 10);

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

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

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