예제 #1
0
        public async void File_Upload_Download_Delete()
        {
            const string filename = "unencrypted_file";

            // Upload file
            await using var uploadMs = new MemoryStream(file);
            var successfulUpload = await bucket.UploadFile(BucketName, filename, file.Length, uploadMs);

            Assert.True(successfulUpload);

            // Download file
            await using var downloadMs = new MemoryStream();
            var successfulDownload = await bucket.DownloadFile(BucketName, filename, file.Length, downloadMs);

            Assert.True(successfulDownload);

            // Compare file
            Assert.Equal(file, downloadMs.ToArray());

            // Remove uploaded file
            var successfulDeleted = await bucket.DeleteFile(BucketName, filename);

            Assert.True(successfulDeleted);
        }