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; }
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(); }
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(); } } }
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(); } } }
public void setup() { getContainers = new GetContainers("http://storageurl"); }
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(); }