public async Task GetBlobScenarioTest(string containerName, string blobName, BlobProperties properties, string leaseId,
                                              byte[] content, HttpStatusCode?expectedError)
        {
            HttpRequestMessage request = BlobTests.GetBlobRequest(BlobContext, containerName, blobName, AccessCondition.GenerateLeaseCondition(leaseId));

            Assert.IsTrue(request != null, "Failed to create HttpRequestMessage");

            using (HttpResponseMessage response = await BlobTestUtils.GetResponse(request, BlobContext))
            {
                BlobTests.GetBlobResponse(response, BlobContext, properties, content, expectedError);
            }
        }
示例#2
0
        public void GetBlobScenarioTest(string containerName, string blobName, BlobProperties properties, string leaseId,
                                        byte[] content, HttpStatusCode?expectedError)
        {
            HttpWebRequest request = BlobTests.GetBlobRequest(BlobContext, containerName, blobName, AccessCondition.GenerateLeaseCondition(leaseId));

            Assert.IsTrue(request != null, "Failed to create HttpWebRequest");
            if (BlobContext.Credentials != null)
            {
                BlobTests.SignRequest(request, BlobContext);
            }
            HttpWebResponse response = BlobTestUtils.GetResponse(request, BlobContext);

            try
            {
                BlobTests.GetBlobResponse(response, BlobContext, properties, content, expectedError);
            }
            finally
            {
                response.Close();
            }
        }