public SimulatedWorkerRequest(string path, ISimulatedWorkerRequestContext context, TextWriter output)
     : base(path, context.QueryString, output)
 {
     bodyString = context.BodyString;
     cookies = context.Cookies;
     formValues = context.FormValues;
     headers = context.Headers;
     method = context.Method;
     protocol = context.Protocol;
     rawHttpRequest = new RawHttpRequest(method, protocol);
 }
        /// <summary>
        /// Creates an instance of <see cref="BrowserContext"/>.
        /// </summary>
        /// <param name="mvcMajorVersion">The major version of the MVC framework</param>
        /// <param name="method">The HTTP method.</param>
        public BrowserContext(int mvcMajorVersion, string method)
        {
            MvcMajorVersion = mvcMajorVersion;
            context = this;
            context.Cookies = new HttpCookieCollection();
            context.FormValues = new NameValueCollection();
            context.Headers = new NameValueCollection();
            context.Method = method;
            context.Protocol = "http";
            context.QueryString = string.Empty;

            context.Headers["Content-Type"] = "application/octet-stream";
        }