Ejemplo n.º 1
0
        private WebDavClient CreateWebDavClient(MockHttpMessageHandler mockHandler)
        {
            var credentials = new NetworkCredential(UserName, Password);

            var httpClientHandler = new HttpClientHandler()
            {
                Credentials     = credentials,
                PreAuthenticate = true
            };

            var debugHttpMessageHandler = new DebugHttpMessageHandler(httpClientHandler)
            {
                InnerHandler = mockHandler
            };

            var wdc = new WebDavClient(debugHttpMessageHandler);

            return(wdc);
        }
        private WebDavSession CreateWebDavSession(MockHttpMessageHandler mockHandler)
        {
            var credentials = new NetworkCredential(UserName, Password);

            var httpClientHandler = new HttpClientHandler()
            {
                Credentials     = credentials,
                PreAuthenticate = true
            };

            var debugHttpMessageHandler = new DebugHttpMessageHandler(httpClientHandler)
            {
                InnerHandler = mockHandler
            };

            var session = new WebDavSession(debugHttpMessageHandler)
            {
                BaseUri = new Uri(WebDavRootFolder, UriKind.Absolute)
            };

            return(session);
        }