Example #1
0
        public void Should_Download_Url_Secured()
        {
            var configuration = MockConfiguration(true);
            var azureClient   = new WindowsAzureStorageService(configuration);

            ShouldDownloadUrl(configuration, azureClient);
        }
Example #2
0
        public void Should_Copy_Object()
        {
            var configuration = MockConfiguration();
            var azureClient   = new WindowsAzureStorageService(configuration);

            ShouldCopyObject(configuration, azureClient);
        }
Example #3
0
        public void Should_Copy_Object()
        {
            Assert.Ignore("TODO: Fix when possible.");
            var configuration = MockConfiguration();
            var azureClient   = new WindowsAzureStorageService(configuration);

            ShouldCopyObject(configuration, azureClient);
        }
Example #4
0
        public void Should_Download_Url_Secured()
        {
            Assert.Ignore("TODO: Fix when possible.");
            var configuration = MockConfiguration(true);
            var azureClient   = new WindowsAzureStorageService(configuration);

            ShouldDownloadUrl(configuration, azureClient);
        }
Example #5
0
        public void Should_Not_Download_Url_Secured()
        {
            Assert.Ignore("TODO: Fix when possible: need different containers (secured and unsecured).");

            var configuration = MockConfiguration(true);
            var azureClient   = new WindowsAzureStorageService(configuration);

            ShouldNotDownloadUrlSecured(configuration, azureClient);
        }
Example #6
0
        public void Should_Remove_Object()
        {
            var azureClient = new WindowsAzureStorageService(CreateCmsConfigurationMock());
            var uri         = new Uri("http://bettercms.blob.core.windows.net/temp/newFile4copy.jpg");

            GetUploadRequest(uri, azureClient);
            azureClient.RemoveObject(uri);
            Assert.IsFalse(azureClient.ObjectExists(uri));
        }
Example #7
0
        public void Should_Fail_Timeout()
        {
            Assert.Ignore("TODO: Fix when possible.");

            var configuration = MockConfiguration(true);
            var azureClient   = new WindowsAzureStorageService(configuration);

            azureClient.Timeout = new TimeSpan(0, 0, 0, 0, 1);

            ShouldUploadObject(configuration, azureClient, false);
        }
Example #8
0
        public void Should_Download_Object()
        {
            var azureClient = new WindowsAzureStorageService(CreateCmsConfigurationMock());
            var uri         = new Uri("http://bettercms.blob.core.windows.net/temp/newFile4.jpg");

            GetUploadRequest(uri, azureClient);
            var file = azureClient.DownloadObject(uri);

            Assert.IsTrue(file.ResponseStream.Length > 0);
            azureClient.RemoveObject(uri);
        }
Example #9
0
        public void Should_Remove_Folder()
        {
            var uri         = new Uri("http://bettercms.blob.core.windows.net/temp/folder/gifas.gif");
            var uri1        = new Uri("http://bettercms.blob.core.windows.net/temp/folder/gifas1.gif");
            var azureClient = new WindowsAzureStorageService(CreateCmsConfigurationMock());

            GetUploadRequest(uri, azureClient);
            GetUploadRequest(uri1, azureClient);
            azureClient.RemoveFolder(uri);
            Assert.IsFalse(azureClient.ObjectExists(uri));
            Assert.IsFalse(azureClient.ObjectExists(uri1));
        }
Example #10
0
        public void Should_Copy_Object()
        {
            var azureClient = new WindowsAzureStorageService(CreateCmsConfigurationMock());
            var source      = new Uri("http://bettercms.blob.core.windows.net/temp/newFile4.jpg");

            GetUploadRequest(source, azureClient);
            var destination = new Uri("http://bettercms.blob.core.windows.net/temp/newFile4 copy.jpg");

            azureClient.CopyObject(new Uri("http://bettercms.blob.core.windows.net/temp/newFile4.jpg"), destination);
            Assert.IsTrue(azureClient.ObjectExists(destination));
            azureClient.RemoveObject(source);
            azureClient.RemoveObject(destination);
        }
Example #11
0
        public void Should_Check_If_Object_Exists()
        {
            ICmsConfiguration config = CreateCmsConfigurationMock();

            var azureClient = new WindowsAzureStorageService(config);
            var uri         = new Uri("http://bettercms.blob.core.windows.net/temp/47.jpg");

            GetUploadRequest(uri, azureClient);
            bool exits = azureClient.ObjectExists(uri);

            bool notExist = azureClient.ObjectExists(new Uri("http://bettercms.blob.core.windows.net/temp/47      .jpg"));

            Assert.IsTrue(exits);
            Assert.IsFalse(notExist);
        }