Ejemplo n.º 1
0
        public static Task RunHttpClient(
            TestContext ctx, CancellationToken cancellationToken, HttpServer server,
            HttpClientHandler handler, RedirectHandler redirect = null,
            HttpStatusCode expectedStatus    = HttpStatusCode.OK,
            WebExceptionStatus expectedError = WebExceptionStatus.Success)
        {
            var runner = new HttpClientTestRunner(server, handler, redirect);

            return(runner.Run(ctx, cancellationToken, expectedStatus, expectedError));
        }
Ejemplo n.º 2
0
        public HttpClientHandler(HttpClientTestRunner parent, bool closeConnection)
            : base(parent, parent.EffectiveType.ToString())
        {
            CloseConnection = closeConnection;

            Flags = RequestFlags.KeepAlive;
            if (CloseConnection)
            {
                Flags |= RequestFlags.CloseConnection;
            }
        }