コード例 #1
0
 protected Mock<ICloudFilesRequest> GetMockrequest(Dictionary<GetListParameters, string> parameters,
     out Uri uri)
 {
     var getContainerItemList = new GetContainers("http://storageurl", parameters);
     var _mockrequest = new Mock<ICloudFilesRequest>();
     getContainerItemList.Apply(_mockrequest.Object);
     uri = getContainerItemList.CreateUri();
     return _mockrequest;
 }
コード例 #2
0
        public void Should_return_No_Content_status()
        {
            Assert.Ignore("Is returning OK instead of NoContent, need to investigate - 7/14/2010");
            var request = new GetContainers(storageUrl);

            var response = new GenerateRequestByType(
                new RequestFactoryWithAgentSupport("NASTTestUserAgent")).Submit(request, authToken);

            Assert.That(response.Status, Is.EqualTo(HttpStatusCode.NoContent));
            if(response.ContentBody != null)
                Assert.That(response.ContentBody.Count, Is.EqualTo(0));
            response.Dispose();
        }
コード例 #3
0
        public void Should_return_the_list_of_containers()
        {
            using (new TestHelper(authToken, storageUrl))
            {
                ICloudFilesResponse response = null;
                try
                {
                    GetContainers request = new GetContainers(storageUrl);
                    response = new GenerateRequestByType().Submit(request, authToken);
                    Assert.That(response.ContentBody.Count, Is.GreaterThan(0));

                }
                finally
                {
                    if (response != null)
                        response.Dispose();
                }
            }
        }
コード例 #4
0
        public void Should_return_OK_status()
        {
            using(new TestHelper(authToken, storageUrl))
            {
                ICloudFilesResponse response = null;
                try
                {
                    GetContainers request = new GetContainers(storageUrl);

                    response = new GenerateRequestByType(new RequestFactoryWithAgentSupport("NASTTestUserAgent")).Submit(request, authToken);

                    Assert.That(response.Status, Is.EqualTo(HttpStatusCode.OK));
                    Assert.That(response.ContentBody, Is.Not.Null);
                }
                finally
                {
                    if(response != null)
                        response.Dispose();
                }
            }
        }
コード例 #5
0
 public void setup()
 {
     getContainers = new GetContainers("http://storageurl");
 }
コード例 #6
0
 private List<string> BuildContainerList(Dictionary<GetListParameters, string> parameters)
 {
     IList<string> containerList = new List<string>();
     var getContainers = new GetContainers(StorageUrl, parameters);
     var getContainersResponse = _requestfactory.Submit(getContainers, AuthToken, _usercreds.ProxyCredentials);
     if (getContainersResponse.Status == HttpStatusCode.OK)
     {
         containerList = getContainersResponse.ContentBody;
     }
     return containerList.ToList();
 }