Exemplo n.º 1
0
        public void SetToStoppedTest()
        {
            var job = new Job
            {
                AppID   = AppID,
                Created = DateTime.Now,
                Command = JobCommand.Stop
            };

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

            var count = jobDAL.SetToStopped(new List <string> {
                job.JobID
            });
            var outJob = jobDAL.GetJob(job.JobID);

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

            Assert.NotNull(outJob);
            Assert.True(count == 1);
            Assert.True(string.IsNullOrWhiteSpace(outJob.Command));
            Assert.Equal(JobStatus.Stopped, outJob.Status);
        }