Ejemplo n.º 1
0
        public void JobDeleteJobRequest()
        {
            CreateJobResponse createResponse = Zencoder.CreateJob("s3://bucket-name/file-name.avi", null, null, null, true, false);

            Assert.IsTrue(createResponse.Success);

            // TODO: Investigate whether Zencoder has truly deprecated this API operation.
            // For now, just test for an InConflict status, because that's what it seems
            // we should expect.
            DeleteJobResponse deleteResponse = Zencoder.DeleteJob(createResponse.Id);

            Assert.IsTrue(deleteResponse.InConflict);

            AutoResetEvent[] handles = new AutoResetEvent[] { new AutoResetEvent(false) };

            Zencoder.DeleteJob(
                createResponse.Id,
                r =>
            {
                Assert.IsTrue(r.InConflict);
                handles[0].Set();
            });

            WaitHandle.WaitAll(handles);
        }
Ejemplo n.º 2
0
        public void JobDeleteJobRequest()
        {
            CreateJobResponse createResponse = Zencoder.CreateJob("s3://bucket-name/file-name.avi", null, null, null, true);

            Assert.IsTrue(createResponse.Success);

            DeleteJobResponse deleteResponse = Zencoder.DeleteJob(createResponse.Id);

            Assert.IsTrue(deleteResponse.Success);

            AutoResetEvent[] handles = new AutoResetEvent[] { new AutoResetEvent(false) };

            Zencoder.DeleteJob(
                createResponse.Id,
                r =>
            {
                Assert.IsTrue(r.StatusCode == HttpStatusCode.NotFound);
                handles[0].Set();
            });

            WaitHandle.WaitAll(handles);
        }