public void Should_return_no_content_when_the_container_exists()
 {
     PutContainer(storageUrl, Constants.CONTAINER_NAME);
     var deleteContainer = new DeleteContainer(storageUrl, Constants.CONTAINER_NAME);
     var response = new GenerateRequestByType().Submit(deleteContainer, authToken);
     Assert.That(response.Status, Is.EqualTo(HttpStatusCode.NoContent));
 }
        public void Should_return_404_when_container_does_not_exist()
        {
            var deleteContainer = new DeleteContainer(storageUrl,  Guid.NewGuid().ToString());

             new GenerateRequestByType().Submit(deleteContainer, authToken);
            Assert.Fail("404 Not found exception expected");
        }
        private void DeleteContainer(string storageUri, string containerName)
        {
            DeleteContainer deleteContainer = new DeleteContainer(storageUri,  containerName);

            IResponse response = new GenerateRequestByType().Submit(deleteContainer, authToken);
            Assert.That(response.Status, Is.EqualTo(HttpStatusCode.NoContent));
        }
        public void when_purging_a_public_container_wit_multiple_purge_email_addresses()
        {
            var deleteContainer = new DeleteContainer("http://cdnmanagementurl", "containername", new[] { "*****@*****.**", "*****@*****.**" });
            var mockrequest = new Mock<ICloudFilesRequest>();
            var webheaders = new WebHeaderCollection();
            mockrequest.SetupGet(x => x.Headers).Returns(webheaders);

            Assert.That(deleteContainer.CreateUri().ToString(), Is.EqualTo("http://cdnmanagementurl/containername"));

            deleteContainer.Apply(mockrequest.Object);

            mockrequest.VerifySet(x => x.Method = "DELETE");
            webheaders.KeyValueFor(Constants.X_PURGE_EMAIL).HasValueOf("[email protected],[email protected]");
        }
 protected override void SetUp()
 {
     deleteContainer = new DeleteContainer("http://storageurl", "containername");
     mockrequest = new Mock<ICloudFilesRequest>();
     deleteContainer.Apply(mockrequest.Object);
 }
Exemplo n.º 6
0
 private void purgePublicContainer(string url, string containerName, string[] emailAddresses)
 {
     var deleteContainer = new DeleteContainer(url, containerName, emailAddresses);
     _requestfactory.Submit(deleteContainer, AuthToken, _usercreds.ProxyCredentials);
 }
Exemplo n.º 7
0
 private void deleteContainer(string url, string containerName, bool emptyContainerBeforeDelete)
 {
     if(emptyContainerBeforeDelete)
     {
         var list = getContainerItemList(containerName, null, true);
         if(list.Count > 0)
         {
             foreach(var item in list)
             {
                 deleteStorageItem(containerName, item);
             }
         }
     }
     var deleteContainer = new DeleteContainer(url, containerName, null);
     _requestfactory.Submit(deleteContainer, AuthToken, _usercreds.ProxyCredentials);
 }
Exemplo n.º 8
0
 private void deleteContainer(string url, string containerName)
 {
     var deleteContainer = new DeleteContainer(url, containerName, null);
     _requestfactory.Submit(deleteContainer, AuthToken, _usercreds.ProxyCredentials);
 }