Microsoft.WindowsAzure.MediaServices.Client.Tests.JobTests.WaitForJobStateAndUpdatePriority C# (CSharp) Method

WaitForJobStateAndUpdatePriority() private method

Waits for expected job state and updates job priority.
private WaitForJobStateAndUpdatePriority ( IJob job, JobState expectedJobState, int newPriority ) : void
job IJob The job.
expectedJobState JobState Expected state of the job.
newPriority int The new priority.
return void
        private void WaitForJobStateAndUpdatePriority(IJob job, JobState expectedJobState, int newPriority)
        {
            WaitForJob(job.Id, expectedJobState, (string id) => { });

            job = _mediaContext.Jobs.Where(c => c.Id == job.Id).FirstOrDefault();
            Assert.IsNotNull(job);
            Assert.AreEqual(InitialJobPriority, job.Priority);
            job.Priority = newPriority;
            job.Update();

            job = _mediaContext.Jobs.Where(c => c.Id == job.Id).FirstOrDefault();
            Assert.IsNotNull(job);
            Assert.AreEqual(newPriority, job.Priority, "Job Priority is not matching expected value");
        }
JobTests