public async Task TestUri() { CloudBlockBlob blob = await CreateEmptyBlob("blob"); AzureBlob azureBlob = new AzureBlob(blob); Assert.AreEqual(blob.Uri.ToString(), azureBlob.Uri); }
public Task<IRemoteFile> GetFile(string name) { return Task.Run(() => { IRemoteFile file = new AzureBlob(_blobContainer.GetBlockBlobReference(name)); return file; }); }
public Task <IRemoteFile> GetFile(string name) { return(Task.Run(() => { IRemoteFile file = new AzureBlob(_cloudBlobDirectory.GetBlockBlobReference(name)); return file; })); }
public async Task TestName() { string blobName = "blob"; CloudBlockBlob blob = await CreateEmptyBlob(blobName); AzureBlob azureBlob = new AzureBlob(blob); Assert.AreEqual(blobName, azureBlob.Name); }
public Task <IRemoteFile> GetFile(string name) { return(Task.Run(() => { IRemoteFile file = new AzureBlob(_blobContainer.GetBlockBlobReference(name)); return file; })); }
public async Task TestDownloadText() { string text = "some text in the blob"; CloudBlockBlob blob = await CreateEmptyBlob("blob"); blob.UploadText(text); AzureBlob azureBlob = new AzureBlob(blob); Assert.AreEqual(text, azureBlob.DownloadText().Result); }
public Task<IRemoteFile> GetFile(string name) { return Task.Run(() => { IRemoteFile file = new AzureBlob(_cloudBlobDirectory.GetBlockBlobReference(name)); return file; }); }
public async Task TestNameOfBlobInDirectory() { string blobName = "blob"; CloudBlobContainer container = _blobClient.GetContainerReference("container"); container.CreateIfNotExists(); CloudBlobDirectory directory = container.GetDirectoryReference("directory"); CloudBlockBlob blob = directory.GetBlockBlobReference(blobName); await BlobUtils.CreateEmptyBlob(blob); AzureBlob azureBlob = new AzureBlob(blob); Assert.AreEqual(blobName, azureBlob.Name); }
public async Task TestDownload() { CloudBlockBlob blob = await CreateEmptyBlob("blob"); AzureBlob azureBlob = new AzureBlob(blob); string path = Path.Combine(Path.GetTempPath(), "azureblobtest"); File.Delete(path); await azureBlob.Download(path); Assert.IsTrue(File.Exists(path)); }
public async Task TestExists() { CloudBlockBlob blob = await CreateEmptyBlob("blob"); AzureBlob azureBlob = new AzureBlob(blob); Assert.IsTrue(await azureBlob.Exists()); blob.Delete(); Assert.IsFalse(await azureBlob.Exists()); }