/// <inheritdoc/> public async Task UpdateStorageContainer(StorageContainer container) { container.AssertIsNotNull("container", "Cannot update a storage container with a null container."); var client = this.GetPocoClient(); await client.UpdateStorageContainer(container); }
public async Task UpdateStorageContainer(StorageContainer container) { await UpdateStorageContainerDelegate(container); }
/// <inheritdoc/> public async Task CreateStorageContainer(string containerName, IDictionary<string, string> metadata) { containerName.AssertIsNotNullOrEmpty("containerName", "Cannot create a storage container with a container name that is null or empty."); var requestObject = new StorageContainer(containerName, metadata); var client = this.GetPocoClient(); await client.CreateStorageContainer(requestObject); }
public async Task CreateStorageContainer(StorageContainer container) { await this.CreateStorageContainerDelegate(container); }
public async Task ExceptionThrownWhenUpdatingAStorageContainerWithInternalServerError() { var containerName = "TestContainer"; var containerReq = new StorageContainer(containerName, new Dictionary<string, string>()); var restResp = new HttpResponseAbstraction(new MemoryStream(), new HttpHeadersAbstraction(), HttpStatusCode.InternalServerError); this.StorageServiceRestClient.Responses.Enqueue(restResp); var client = new StorageServicePocoClient(GetValidContext(), this.ServiceLocator); await client.UpdateStorageContainer(containerReq); }
public async Task CanCreateStorageContainerWithNoContentResponse() { var containerName = "TestContainer"; var headers = new HttpHeadersAbstraction { {"X-Container-Bytes-Used", "12345"}, {"X-Container-Object-Count", "1"} }; var restResp = new HttpResponseAbstraction(new MemoryStream(), headers, HttpStatusCode.NoContent); this.StorageServiceRestClient.Responses.Enqueue(restResp); var containerReq = new StorageContainer(containerName, new Dictionary<string, string>()); var client = new StorageServicePocoClient(GetValidContext(), this.ServiceLocator); await client.CreateStorageContainer(containerReq); //Assert.IsNotNull(container); //Assert.AreEqual(containerName, container.Name); //Assert.AreEqual(12345, container.TotalBytesUsed); }
/// <inheritdoc/> public async Task UpdateStorageContainer(StorageContainer container) { container.Name.AssertIsNotNullOrEmpty("container.Name", "Cannot update a storage container with a name that is null or empty."); var client = this.GetRestClient(); var resp = await client.UpdateContainer(container.Name, container.Metadata); if (resp.StatusCode != HttpStatusCode.NoContent) { throw new InvalidOperationException(string.Format("Failed to update storage container '{0}'. The remote server returned the following status code: '{1}'.", container.Name, resp.StatusCode)); } }