Exemple #1
0
        public static HttpWebRequest ListFilesAndDirectoriesRequest(FileContext context, string shareName, FileListingContext listingContext)
        {
            Uri uri = FileClientTests.ConstructUri(context.Address, shareName);
            OperationContext opContext = new OperationContext();
            HttpWebRequest   request   = DirectoryHttpWebRequestFactory.List(uri, context.Timeout, listingContext, true, opContext);

            Assert.IsNotNull(request);
            Assert.IsNotNull(request.Method);
            Assert.AreEqual("GET", request.Method);
            FileTestUtils.RangeHeader(request, null);
            return(request);
        }
Exemple #2
0
        public static HttpWebRequest ListSharesRequest(FileContext context, ListingContext listingContext)
        {
            Uri uri = FileClientTests.ConstructUri(context.Address);
            OperationContext opContext = new OperationContext();
            HttpWebRequest   request   = ShareHttpWebRequestFactory.List(uri, context.Timeout, listingContext, ShareListingDetails.Metadata, true, opContext);

            Assert.IsNotNull(request);
            Assert.IsNotNull(request.Method);
            Assert.AreEqual("GET", request.Method);
            FileTestUtils.RangeHeader(request, null);
            return(request);
        }
Exemple #3
0
        public static HttpWebRequest DeleteFileRequest(FileContext context, string shareName, string fileName, AccessCondition accessCondition)
        {
            Uri uri = FileClientTests.ConstructUri(context.Address, shareName, fileName);
            OperationContext opContext = new OperationContext();
            HttpWebRequest   request   = FileHttpWebRequestFactory.Delete(uri, context.Timeout, accessCondition, true, opContext);

            Assert.IsNotNull(request);
            Assert.IsNotNull(request.Method);
            Assert.AreEqual("DELETE", request.Method);
            FileTestUtils.RangeHeader(request, null);
            return(request);
        }
        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);
        }
        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);
        }
Exemple #6
0
        public static HttpWebRequest CreateShareRequest(FileContext context, string shareName)
        {
            Uri uri = FileClientTests.ConstructUri(context.Address, shareName);
            OperationContext opContext = new OperationContext();
            HttpWebRequest   request   = ShareHttpWebRequestFactory.Create(uri, context.Timeout, true, opContext);

            Assert.IsNotNull(request);
            Assert.IsNotNull(request.Method);
            Assert.AreEqual("PUT", request.Method);
            FileTestUtils.RangeHeader(request, null);
            FileTestUtils.VersionHeader(request, false);
            return(request);
        }
        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);
        }