public async Task ExceptionthrownWhenGettingAStorageContainerAndServerError() { var containerName = "TestContainer"; var restResp = new HttpResponseAbstraction(new MemoryStream(), new HttpHeadersAbstraction(), HttpStatusCode.InternalServerError); this.StorageServiceRestClient.Responses.Enqueue(restResp); var client = new StorageServicePocoClient(GetValidContext(), this.ServiceLocator); await client.GetStorageContainer(containerName); }
public async Task CannotGetStorageContainerWithNullName() { var client = new StorageServicePocoClient(GetValidContext(), this.ServiceLocator); await client.GetStorageContainer(null); }
public async Task CanGetStorageContainerWithNoContent() { var containerName = "TestContainer"; var headers = new HttpHeadersAbstraction() { {"X-Container-Bytes-Used", "0"}, {"X-Container-Object-Count", "0"} }; var restResp = new HttpResponseAbstraction(new MemoryStream(), headers, HttpStatusCode.NoContent); this.StorageServiceRestClient.Responses.Enqueue(restResp); var client = new StorageServicePocoClient(GetValidContext(), this.ServiceLocator); var result = await client.GetStorageContainer(containerName); Assert.IsNotNull(result); Assert.AreEqual(containerName, result.Name); Assert.AreEqual(0, result.TotalBytesUsed); Assert.AreEqual(0, result.TotalObjectCount); Assert.IsNotNull(result.Objects); Assert.AreEqual(0, result.Objects.Count()); }