Example #1
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 #2
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 #3
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);
        }