コード例 #1
0
        /// <summary>
        /// creates the handler for integration testing
        /// </summary>
        /// <returns>the handler to override the httpClient default handler with</returns>
        protected Microsoft.AspNetCore.Mvc.Testing.Handlers.RedirectHandler getHttpClientHandler2()
        {
            Microsoft.AspNetCore.Mvc.Testing.Handlers.RedirectHandler        result        = new Microsoft.AspNetCore.Mvc.Testing.Handlers.RedirectHandler(7);
            Microsoft.AspNetCore.Mvc.Testing.Handlers.CookieContainerHandler innerHandler1 = new Microsoft.AspNetCore.Mvc.Testing.Handlers.CookieContainerHandler();
            Microsoft.AspNetCore.TestHost.ClientHandler innerHandler2 = (Microsoft.AspNetCore.TestHost.ClientHandler) this.webApplicationFactory2.Server.CreateHandler();  //TODO: check if one client handler is valid for all redirects
            innerHandler1.InnerHandler = innerHandler2;
            result.InnerHandler        = innerHandler1;

            return(result);
        }
コード例 #2
0
        /// <summary>
        /// creates the handler for integration testing
        /// </summary>
        /// <returns>the handler to override the httpClient default handler with</returns>
        protected Microsoft.AspNetCore.Mvc.Testing.Handlers.RedirectHandler getHttpClientHandler()
        {
            Microsoft.AspNetCore.Mvc.Testing.Handlers.RedirectHandler        result        = new Microsoft.AspNetCore.Mvc.Testing.Handlers.RedirectHandler(7);
            Microsoft.AspNetCore.Mvc.Testing.Handlers.CookieContainerHandler innerHandler1 = new Microsoft.AspNetCore.Mvc.Testing.Handlers.CookieContainerHandler();
            Microsoft.AspNetCore.TestHost.ClientHandler innerHandler2 = (Microsoft.AspNetCore.TestHost.ClientHandler) this.webApplicationFactory.Server.CreateHandler();
            innerHandler1.InnerHandler = innerHandler2;
            result.InnerHandler        = innerHandler1;

            return(result);
        }
コード例 #3
0
        /// <summary>
        /// creates the handler for integration testing
        /// </summary>
        /// <returns>the handler to override the httpClient default handler with</returns>
        protected Microsoft.AspNetCore.Mvc.Testing.Handlers.RedirectHandler getHttpClientHandler(Guid ServerId)
        {
            Microsoft.AspNetCore.Mvc.Testing.Handlers.RedirectHandler result = default;

            if (this.servers.ContainsKey(ServerId))
            {
                result = new Microsoft.AspNetCore.Mvc.Testing.Handlers.RedirectHandler(7);
                Microsoft.AspNetCore.Mvc.Testing.Handlers.CookieContainerHandler innerHandler1 = new Microsoft.AspNetCore.Mvc.Testing.Handlers.CookieContainerHandler();
                Microsoft.AspNetCore.TestHost.ClientHandler innerHandler2 = (Microsoft.AspNetCore.TestHost.ClientHandler) this.servers[ServerId].GetServer().CreateHandler();
                innerHandler1.InnerHandler = innerHandler2;
                result.InnerHandler        = innerHandler1;
            }
            return(result);
        }