コード例 #1
0
ファイル: JobDALRedisAsyncTest.cs プロジェクト: lulzzz/Shift
        public async Task SetToCompletedAsyncTest()
        {
            var job = new Job();

            job.AppID     = AppID;
            job.Created   = DateTime.Now;
            job.Status    = null;
            job.ProcessID = processID;
            job           = await jobDAL.SetJobAsync(job);

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

            var count = await jobDAL.SetToCompletedAsync(job.ProcessID, job.JobID);

            var outJob = await jobDAL.GetJobAsync(job.JobID);

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

            Assert.NotNull(outJob);
            Assert.True(count == 1);
            Assert.Equal(JobStatus.Completed, outJob.Status);
        }