public void UseBucket() { try { var storageClient = StorageClientHelper.GetStorageClient(); this.TestBucket(FirebaseApp.DefaultInstance.GetProjectId(), storageClient); } catch (Exception ex) { Assert.NotEmpty(ex.Message); } }
public void UseAfterDelete() { try { var app = FirebaseApp.Create(new AppOptions() { Credential = MockCredential }); StorageClient storageClient = StorageClientHelper.GetStorageClient(app); app.Delete(); Assert.Throws <ObjectDisposedException>( () => storageClient.GetBucket("test")); } catch (Exception ex) { Assert.NotEmpty(ex.Message); } }
public void GetDefaultStorageClient() { try { var app = FirebaseApp.Create(new AppOptions() { Credential = MockCredential }); StorageClient storageClient = StorageClientHelper.GetStorageClient(); Assert.Same(storageClient, StorageClientHelper.GetStorageClient()); app.Delete(); Assert.Null(StorageClientHelper.GetStorageClient()); } catch (Exception ex) { Assert.NotEmpty(ex.Message); } }
public void GetStorageClient() { try { var app = FirebaseApp.Create(new AppOptions() { Credential = MockCredential }); StorageClient storageClient = StorageClientHelper.GetStorageClient(app); Assert.Same(storageClient, StorageClientHelper.GetStorageClient(app)); app.Delete(); Assert.Throws <InvalidOperationException>(() => StorageClientHelper.GetStorageClient(app)); } catch (Exception ex) { Assert.NotEmpty(ex.Message); } }
public void GetStorageClientWithoutApp() { Assert.Null(StorageClientHelper.GetStorageClient()); }