public void ShouldCreateJobWithMultipleAssetsAndValidateParentLinks()
{
// Create multiple assets, set them as parents for a job, and validate that the parent links are set.
IAsset asset1 = AssetTests.CreateAsset(_mediaContext, _smallWmv, AssetCreationOptions.StorageEncrypted);
IAsset asset2 = AssetTests.CreateAsset(_mediaContext, WindowsAzureMediaServicesTestConfiguration.SmallWmv2, AssetCreationOptions.StorageEncrypted);
IAsset asset3 = AssetTests.CreateAsset(_mediaContext, WindowsAzureMediaServicesTestConfiguration.SmallMp41, AssetCreationOptions.StorageEncrypted);
string configuration = File.ReadAllText(WindowsAzureMediaServicesTestConfiguration.MultiConfig);
IJob job = _mediaContext.Jobs.Create("Test");
IMediaProcessor mediaProcessor = GetMediaProcessor(_mediaContext, WindowsAzureMediaServicesTestConfiguration.MpEncoderName);
ITask task = job.Tasks.AddNew("Task1", mediaProcessor, configuration, TaskOptions.None);
task.InputAssets.Add(asset1);
task.InputAssets.Add(asset2);
task.InputAssets.Add(asset3);
task.OutputAssets.AddNew("JobOutput", options: AssetCreationOptions.None);
job.Submit();
WaitForJob(job.Id, JobState.Finished, VerifyAllTasksFinished, delegate(double d) { Console.WriteLine(d); });
Assert.IsTrue(job.OutputMediaAssets[0].ParentAssets.Count == 3);
IEnumerable<string> parentIds = job.OutputMediaAssets[0].ParentAssets.Select(a => a.Id);
Assert.IsTrue(parentIds.Contains(asset1.Id));
Assert.IsTrue(parentIds.Contains(asset2.Id));
Assert.IsTrue(parentIds.Contains(asset3.Id));
}