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)); }
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); }
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)); }
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); }