Ejemplo n.º 1
0
        /// <summary>
        /// simulates a browser load
        /// </summary>
        /// <param name="address">address to load</param>
        /// <param name="parameters">parameters for request</param>
        /// <returns>response of browser</returns>
        public BrowserResponse Load(string address, WebRequestParameters parameters = null)
        {
            SimulationResponse response = datafunc(address, parameters);

            if (!string.IsNullOrEmpty(response.RedirectionTarget))
            {
                if (Redirect?.Invoke(response.RedirectionTarget) ?? false)
                {
                    return(Load(response.RedirectionTarget));
                }
            }

            return(new BrowserResponse(response.ResponseData, response.ResponseEncoding));
        }
Ejemplo n.º 2
0
 bool OnRedirect(string target)
 {
     return(Redirect?.Invoke(target) ?? true);
 }