public void TestListBucketContents() { var bucket = Environment.GetEnvironmentVariable( "GOOGLE_CLOUD_STORAGE_BUCKET" ); var sample = new GoogleCloudSamples.AuthSample(); StorageService storage = sample.CreateAuthorizedClient(); var result = sample.ListBucketContents(storage, bucket); // Make sure the result is a valid list of Cloud Storage objects bool isStorageObjectsList = false; // Create a test Cloud Storage objects list instance to compare with // the result from the API request Objects validStorageObjectsList = (Objects)Activator .CreateInstance(typeof(Objects)); // Compare the API request result type with the test Cloud Storage // objects list to determine if the response is valid isStorageObjectsList = validStorageObjectsList.GetType() == result.GetType(); Assert.IsTrue(isStorageObjectsList); }