public void JobCancelJobRequest() { CreateJobResponse createResponse = Zencoder.CreateJob("s3://bucket-name/file-name.avi", null, null, null, true, false); Assert.IsTrue(createResponse.Success); CancelJobResponse cancelResponse = Zencoder.CancelJob(createResponse.Id); Assert.IsTrue(cancelResponse.Success); }
public void JobCancelJobRequest() { CreateJobResponse createResponse = Zencoder.CreateJob("s3://bucket-name/file-name.avi", null, null, null, true); Assert.IsTrue(createResponse.Success); CancelJobResponse cancelResponse = Zencoder.CancelJob(createResponse.Id); Assert.IsTrue(cancelResponse.Success); AutoResetEvent[] handles = new AutoResetEvent[] { new AutoResetEvent(false) }; Zencoder.CancelJob( createResponse.Id, r => { Assert.IsTrue(r.InConflict); handles[0].Set(); }); WaitHandle.WaitAll(handles); }
public void JobCancelJobRequestAsync() { CreateJobResponse createResponse = Zencoder.CreateJob("s3://bucket-name/file-name.avi", null, null, null, true, false); Assert.IsTrue(createResponse.Success); AutoResetEvent[] handles = new AutoResetEvent[] { new AutoResetEvent(false) }; CancelJobResponse asyncResponse = null; Zencoder.CancelJob( createResponse.Id, r => { asyncResponse = r; handles[0].Set(); }); WaitHandle.WaitAll(handles); Assert.IsNotNull(asyncResponse); Assert.IsTrue(asyncResponse.Success); }