public void ShouldCreateTaskUsingStorageEncryptedAsset() { var filePaths = new[] { WindowsAzureMediaServicesTestConfiguration.SmallWmv }; IAsset asset = AssetTests.CreateAsset(_mediaContext, Path.GetFullPath(WindowsAzureMediaServicesTestConfiguration.SmallWmv), AssetCreationOptions.StorageEncrypted); IMediaProcessor processor = JobTests.GetEncoderMediaProcessor(_mediaContext); IJob job = _mediaContext.Jobs.Create("Encode Job with encrypted asset"); ITask task = job.Tasks.AddNew("Task 1", processor, JobTests.GetWamePreset(processor), TaskOptions.None); task.InputAssets.Add(asset); task.OutputAssets.AddNew("Encrypted Output", AssetCreationOptions.StorageEncrypted); job.Submit(); JobTests.WaitForJob(job.Id, JobState.Finished, JobTests.VerifyAllTasksFinished); CloudMediaContext context2 = WindowsAzureMediaServicesTestConfiguration.CreateCloudMediaContext(); IJob job2 = context2.Jobs.Where(c => c.Id == job.Id).Single(); foreach (IAsset outputAsset in job2.Tasks[0].OutputAssets) { VerifyFileAndContentKeyMetadataForStorageEncryption(outputAsset, _mediaContext); } }
private IAsset RunJobAndGetOutPutAsset(string jobName, out IAsset asset, out IJob job) { asset = CreateAsset(_mediaContext, _smallWmv, AssetCreationOptions.StorageEncrypted); IMediaProcessor mediaProcessor = JobTests.GetMediaProcessor(_mediaContext, WindowsAzureMediaServicesTestConfiguration.MpEncoderName); job = JobTests.CreateAndSubmitOneTaskJob(_mediaContext, jobName, mediaProcessor, JobTests.GetWamePreset(mediaProcessor), asset, TaskOptions.None); JobTests.WaitForJob(job.Id, JobState.Finished, JobTests.VerifyAllTasksFinished); Assert.IsTrue(job.OutputMediaAssets.Count > 0); IAsset outasset = job.OutputMediaAssets[0]; Assert.IsNotNull(outasset); return(outasset); }