public void GetTaskOutputStoragePathReturnsExpectedValue()
        {
            using (var batchClient = BatchClient.Open(new FakeBatchServiceClient()))
            {
                CloudJob job = batchClient.JobOperations.CreateJob();
                job.Id = "fakejob";

                var path = job.GetOutputStoragePath(JobOutputKind.JobOutput);
                Assert.Equal($"${JobOutputKind.JobOutput.ToString()}", path);

                path = job.GetOutputStoragePath(JobOutputKind.JobPreview);
                Assert.Equal($"${JobOutputKind.JobPreview.ToString()}", path);

                path = job.GetOutputStoragePath(JobOutputKind.Custom("foo"));
                Assert.Equal($"${JobOutputKind.Custom("foo").ToString()}", path);
            }
        }
예제 #2
0
        public static CloudTask WithOutputFile(
            this CloudTask task,
            CloudJob job,
            string pattern,
            string containerUrl,
            JobOutputKind outputKind,
            OutputFileUploadCondition uploadCondition)
        {
            var  outputBase = job.GetOutputStoragePath(outputKind);
            bool patternContainsWildcard = pattern.Contains("*");
            var  path = patternContainsWildcard ? outputBase : $"{outputBase}/{pattern}";

            return(task.WithOutputFile(
                       pattern,
                       containerUrl,
                       path,
                       uploadCondition));
        }