Beispiel #1
0
        public async Task DownloadNonExistingFileTest()
        {
            // Upload file
            var filename = Unique.String + ".png";

            // Get download url
            var download = new FileDownload(filename);
            var content  = await download.DownloadAsync();
        }
Beispiel #2
0
        public async Task DownloadAsyncTest()
        {
            // Upload a new file
            var filename = await FileHelper.UploadTestFileAsync();

            // Download the file
            var handler = new FileDownload(filename);

            handler.DownloadCompleted += (s, e) =>
            {
                Console.WriteLine("Download completed. Downloaded {0} bytes.", e.Result.Length);
            };
            handler.DownloadProgressChanged += (s, e) =>
            {
                Console.WriteLine("Downloading {0} bytes out of {1}.", e.BytesReceived, e.TotalBytesToReceive);
            };
            var bytes = await handler.DownloadAsync();

            Assert.IsTrue(FileHelper.Md5ChecksumMatch(bytes));
        }
 public async Task DownloadNonExistingFileTest()
 {
     // Upload file
     var filename = Unique.String + ".png";
     
     // Get download url
     var download = new FileDownload(filename);
     var content = await download.DownloadAsync();
 }
        public async Task DownloadAsyncTest()
        {
            // Upload a new file
            var filename = await FileHelper.UploadTestFileAsync();

            // Download the file
            var handler = new FileDownload(filename);
            handler.DownloadCompleted += (s, e) =>
                {
                    Console.WriteLine("Download completed. Downloaded {0} bytes.", e.Result.Length);
                };
            handler.DownloadProgressChanged += (s, e) =>
                {
                    Console.WriteLine("Downloading {0} bytes out of {1}.", e.BytesReceived, e.TotalBytesToReceive);
                };
            var bytes = await handler.DownloadAsync();
            Assert.IsTrue(FileHelper.Md5ChecksumMatch(bytes));
        }