Esempio n. 1
0
        public static HttpRequestMessage DeleteFileRequest(FileContext context, string shareName, string fileName, AccessCondition accessCondition)
        {
            Uri uri = FileClientTests.ConstructUri(context.Address, shareName, fileName);
            OperationContext   opContext = new OperationContext();
            HttpRequestMessage request   = FileHttpRequestMessageFactory.Delete(uri, context.Timeout, accessCondition, null, opContext, SharedKeyCanonicalizer.Instance, context.Credentials);

            Assert.IsNotNull(request);
            Assert.IsNotNull(request.Method);
            Assert.AreEqual(HttpMethod.Delete, request.Method);
            FileTestUtils.RangeHeader(request, null);
            return(request);
        }
Esempio n. 2
0
        public static HttpRequestMessage ListSharesRequest(FileContext context, ListingContext listingContext)
        {
            Uri uri = FileClientTests.ConstructUri(context.Address);
            OperationContext   opContext = new OperationContext();
            HttpRequestMessage request   = ShareHttpRequestMessageFactory.List(uri, context.Timeout, listingContext, ShareListingDetails.Metadata, null, opContext, SharedKeyCanonicalizer.Instance, context.Credentials);

            Assert.IsNotNull(request);
            Assert.IsNotNull(request.Method);
            Assert.AreEqual(HttpMethod.Get, request.Method);
            FileTestUtils.RangeHeader(request, null);
            return(request);
        }
Esempio n. 3
0
        public static HttpRequestMessage CreateShareRequest(FileContext context, string shareName)
        {
            Uri uri = FileClientTests.ConstructUri(context.Address, shareName);
            OperationContext   opContext = new OperationContext();
            HttpRequestMessage request   = ShareHttpRequestMessageFactory.Create(uri, null, context.Timeout, null, opContext, SharedKeyCanonicalizer.Instance, context.Credentials);

            Assert.IsNotNull(request);
            Assert.IsNotNull(request.Method);
            Assert.AreEqual(HttpMethod.Put, request.Method);
            FileTestUtils.RangeHeader(request, null);
            FileTestUtils.VersionHeader(request, false);
            return(request);
        }