Exemplo n.º 1
0
        public async Task ListDatasetsAsync()
        {
            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.ListDatasetsAsync(projectReference);
            var dataset = await result.Single();

            Assert.Equal(projectId, dataset.Reference.ProjectId);
            Assert.Equal(datasetId, dataset.Reference.DatasetId);
        }