public void AzureProviderUtilitiesGetFileUriThrowsArgumentExceptionOnMissingContainerName()
        {
            var provider = new ArchivialLibrary.StorageProviders.Azure.AzureStorageProviderUtilities();

            var storageAccount = "storage-account";
            var fileID         = "29164dbc-f17b-4643-8f40-868e13b98141";

            var containerName = string.Empty; // should throw
            var fileName      = string.Format("{0}-file-{1}", ArchivialLibrary.Constants.Logging.AppName, fileID).ToLower();

            var computedUri = provider.GetFileUri(storageAccount, containerName, fileName);
        }
        public void AzureProviderUtilitiesGetFileUriThrowsArgumentExceptionOnMissingFileName()
        {
            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 fileName      = string.Empty; // should throw

            var computedUri = provider.GetFileUri(storageAccount, containerName, fileName);
        }
        public void AzureProviderUtilitiesGetFileUriReturnsHttpsUri()
        {
            var provider = new ArchivialLibrary.StorageProviders.Azure.AzureStorageProviderUtilities();

            var storageAccount = "storage-account";
            var folderID       = Guid.NewGuid().ToString();
            var fileID         = Guid.NewGuid().ToString();
            var containerName  = string.Format("{0}-directory-{1}", ArchivialLibrary.Constants.Logging.AppName, folderID).ToLower();

            var uri = provider.GetFileUri(storageAccount, containerName, fileID);

            Assert.IsNotNull(uri);
            Assert.IsTrue(uri.StartsWith("https://"));
        }
        public void AzureProviderUtilitiesGetFileUriReturnsCorrectlyFormattedFullURI()
        {
            var provider = new ArchivialLibrary.StorageProviders.Azure.AzureStorageProviderUtilities();

            var storageAccount = "storage-account";
            var folderID       = "a4b78664-90c9-4957-90a1-66d9c70c0492";
            var fileID         = "29164dbc-f17b-4643-8f40-868e13b98141";

            var containerName = string.Format("{0}-directory-{1}", ArchivialLibrary.Constants.Logging.AppName, folderID).ToLower();
            var fileName      = string.Format("{0}-file-{1}", ArchivialLibrary.Constants.Logging.AppName, fileID).ToLower();

            var computedUri = provider.GetFileUri(storageAccount, containerName, fileName);

            var expected = "https://storage-account.blob.core.windows.net/archivial-directory-a4b78664-90c9-4957-90a1-66d9c70c0492/archivial-file-29164dbc-f17b-4643-8f40-868e13b98141";

            Assert.IsNotNull(computedUri);
            Assert.AreEqual(expected, computedUri);
        }