public void AzureProviderUtilitiesGetContainerUriThrowsArgumentExceptionOnMissingContainerName() { var provider = new ArchivialLibrary.StorageProviders.Azure.AzureStorageProviderUtilities(); var storageAccount = "storage-account"; var containerName = string.Empty; // should throw var computedUri = provider.GetContainerUri(storageAccount, containerName); }
public void AzureProviderUtilitiesGetContainerUriThrowsArgumentExceptionOnMissingStorageAccount() { var provider = new ArchivialLibrary.StorageProviders.Azure.AzureStorageProviderUtilities(); var storageAccount = string.Empty; // should throw var folderID = "a4b78664-90c9-4957-90a1-66d9c70c0492"; var containerName = string.Format("{0}-directory-{1}", ArchivialLibrary.Constants.Logging.AppName, folderID).ToLower(); var computedUri = provider.GetContainerUri(storageAccount, containerName); }
public void AzureProviderUtilitiesGetContainerUriReturnsHttpsUri() { var provider = new ArchivialLibrary.StorageProviders.Azure.AzureStorageProviderUtilities(); var storageAccount = "storage-account"; var folderID = Guid.NewGuid().ToString(); var containerName = string.Format("{0}-directory-{1}", ArchivialLibrary.Constants.Logging.AppName, folderID).ToLower(); var uri = provider.GetContainerUri(storageAccount, containerName); Assert.IsNotNull(uri); Assert.IsTrue(uri.StartsWith("https://")); }
public void AzureProviderUtilitiesGetContainerUriReturnsCorrectlyFormattedFullURI() { var provider = new ArchivialLibrary.StorageProviders.Azure.AzureStorageProviderUtilities(); var storageAccount = "storage-account"; var folderID = "a4b78664-90c9-4957-90a1-66d9c70c0492"; var containerName = string.Format("{0}-directory-{1}", ArchivialLibrary.Constants.Logging.AppName, folderID).ToLower(); var computedUri = provider.GetContainerUri(storageAccount, containerName); var expected = "https://storage-account.blob.core.windows.net/archivial-directory-a4b78664-90c9-4957-90a1-66d9c70c0492"; Assert.IsNotNull(computedUri); Assert.AreEqual(expected, computedUri); }