public async Task ListProjectsAsyncAsync() { var projectId = "project"; var service = new FakeBigqueryService(); var client = new BigQueryClientImpl(projectId, service); var reference = client.GetProjectReference(projectId); service.ExpectRequest( service.Projects.List(), new ProjectList { Projects = new[] { new ProjectsData { ProjectReference = reference } } }); var result = client.ListProjectsAsync(); var dataset = await result.Single(); Assert.Equal(projectId, dataset.Reference.ProjectId); }
public async Task ListJobsAsync() { var projectId = "project"; var jobId = "job"; var service = new FakeBigqueryService(); var client = new BigQueryClientImpl(projectId, service); var projectReference = client.GetProjectReference(projectId); var jobReference = client.GetJobReference(projectId, jobId); service.ExpectRequest( service.Jobs.List(projectId), new JobList { Jobs = new[] { new JobsData { JobReference = jobReference } } }); var result = client.ListJobsAsync(projectReference); var job = await result.Single(); Assert.Equal(projectId, job.Reference.ProjectId); Assert.Equal(jobId, job.Reference.JobId); }
public void ListDatasets() { var projectId = "project"; var datasetId = "dataset"; var service = new FakeBigqueryService(); var client = new BigQueryClientImpl(projectId, service); var projectReference = client.GetProjectReference(projectId); var datasetReference = client.GetDatasetReference(projectId, datasetId); service.ExpectRequest( service.Datasets.List(projectId), new DatasetList { Datasets = new[] { new DatasetsData { DatasetReference = datasetReference } } }); var result = client.ListDatasets(projectReference); var dataset = result.Single(); Assert.Equal(projectId, dataset.Reference.ProjectId); Assert.Equal(datasetId, dataset.Reference.DatasetId); }