public async Task GetBytesTest(string baseDir) { BlobShareProvider provider = new BlobShareProvider(CloudStorageAccount.DevelopmentStorageAccount, ContainerName, baseDir); var filename = Path.GetRandomFileName(); var add = await provider.AddFile(RandomFileGenerator.RandomFileByteArray(1000), filename); var file = await provider.DownloadBytes(filename); Assert.IsTrue(file.Length == 1000); }
public async Task AddFileTest(string baseDir) { BlobShareProvider provider = new BlobShareProvider(CloudStorageAccount.DevelopmentStorageAccount, ContainerName, baseDir); var filename = Path.GetRandomFileName(); var tempFile = Path.GetTempFileName(); using (var file = File.OpenWrite(tempFile)) { await file.WriteAsync(RandomFileGenerator.RandomFileByteArray(1000), 0, 1000); } var add = await provider.AddFile(tempFile, filename); var result = await provider.DownloadBytes(filename); Assert.IsTrue(result.Length == 1000); }