Headless.MemoryHtmlPage.MemoryHtmlPage C# (CSharp) Method

MemoryHtmlPage() public method

Initializes a new instance of the MemoryHtmlPage class.
The parameter is null. The parameter is null, empty or only contains white space.
public MemoryHtmlPage ( IBrowser browser, string html ) : System
browser IBrowser /// The browser. ///
html string /// The HTML. ///
return System
        public MemoryHtmlPage(IBrowser browser, string html)
        {
            if (browser == null)
            {
                throw new ArgumentNullException("browser");
            }

            if (string.IsNullOrWhiteSpace(html))
            {
                throw new ArgumentException(Resources.HtmlPage_NoHtmlContentProvided, "html");
            }

            IEnumerable<HttpOutcome> outcomes = new List<HttpOutcome>
            {
                new HttpOutcome(_targetLocation, HttpMethod.Get, HttpStatusCode.OK, "OK", TimeSpan.FromMilliseconds(5))
            };
            var result = new HttpResult(outcomes);

            Initialize(browser, HttpStatusCode.OK, "OK", result);

            using (var reader = new StringReader(html))
            {
                SetContent(reader);
            }
        }
MemoryHtmlPage