public async Task TestGetSparkBatchJob()
        {
            SparkBatchJobCollection sparkJobs = (await SparkBatchClient.GetSparkBatchJobsAsync()).Value;

            foreach (SparkBatchJob expectedSparkJob in sparkJobs.Sessions)
            {
                SparkBatchJob actualSparkJob = await SparkBatchClient.GetSparkBatchJobAsync(expectedSparkJob.Id);

                ValidateSparkBatchJob(expectedSparkJob, actualSparkJob);
            }
        }
        public static async Task <List <SparkBatchJob> > ListSparkBatchJobsAsync(SparkBatchClient client, bool detailed = true)
        {
            List <SparkBatchJob> batches = new List <SparkBatchJob>();
            int from = 0;
            int currentPageSize;
            int pageSize = 20;

            do
            {
                SparkBatchJobCollection page = (await client.GetSparkBatchJobsAsync(detailed: detailed, from: from, size: pageSize)).Value;
                currentPageSize = page.Total;
                from           += currentPageSize;
                batches.AddRange(page.Sessions);
            } while (currentPageSize == pageSize);
            return(batches);
        }
        public async Task TestGetSparkBatchJob()
        {
            SparkBatchJobCollection sparkJobs = (await SparkBatchClient.GetSparkBatchJobsAsync()).Value;

            foreach (SparkBatchJob expectedSparkJob in sparkJobs.Sessions)
            {
                try
                {
                    SparkBatchJob actualSparkJob = await SparkBatchClient.GetSparkBatchJobAsync(expectedSparkJob.Id);

                    ValidateSparkBatchJob(expectedSparkJob, actualSparkJob);
                }
                catch (Azure.RequestFailedException)
                {
                }
            }
        }