Example #1
0
        public async Task ShouldUploadFile()
        {
            // Arrange
            var firebaseUploader = new FirebaseStorage(CredentialsFile, BucketName);

            // Act
            await firebaseUploader.UploadFile(_tempFile);

            // Assert
            var downloadFile = firebaseUploader.DownloadFile(_tempFile, DownloadLocation);

            Check.ThatAsyncCode(() => downloadFile).DoesNotThrow();
        }
Example #2
0
        public async Task ShouldDownloadFile()
        {
            // Arrange
            var firebaseUploader = new FirebaseStorage(CredentialsFile, BucketName);
            await firebaseUploader.UploadFile(_tempFile);

            // Act
            await firebaseUploader.DownloadFile(_tempFile, DownloadLocation);

            // Assert
            var actualFileContent = await File.ReadAllTextAsync($@"{DownloadLocation}\{_tempFile}");

            Check.That(actualFileContent).IsEqualTo(FileContent);
        }
 public void DownloadFile() => FirebaseStorage.DownloadFile(filePathInputField.text, gameObject.name, "DisplayFile", "DisplayErrorObject");