public void UseBucket()
 {
     try
     {
         var storageClient = StorageClientHelper.GetStorageClient();
         this.TestBucket(FirebaseApp.DefaultInstance.GetProjectId(), storageClient);
     }
     catch (Exception ex)
     {
         Assert.NotEmpty(ex.Message);
     }
 }
예제 #2
0
 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);
     }
 }
예제 #3
0
 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);
     }
 }
예제 #4
0
 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);
     }
 }
예제 #5
0
 public void GetStorageClientWithoutApp()
 {
     Assert.Null(StorageClientHelper.GetStorageClient());
 }