AssignContent() public method

Assigns the content.
public AssignContent ( HttpContent content ) : void
content System.Net.Http.HttpContent /// The content. ///
return void
Example #1
0
        public void ProcessesContentWithCaseInsensitiveAttributeNamesTest()
        {
            const string Html = @"
            <html>
            <body>
            <FORm Name='test'></FORm>
            </body>
            </html>
            ";

            using (var content = StreamContentFactory.FromHtml(Html))
            {
                var page = new HtmlPageWrapper();

                page.AssignContent(content);

                var actual = page.Find<AnyHtmlElement>().AllByAttribute("name", "test");

                actual.Count().Should().Be(1);
            }
        }
Example #2
0
        public void ProcessesContentWithMixedCaseTagNamesAcrossStartAndEndTagsTest()
        {
            const string Html = @"
<html>
<body>
<FORm id='test'></foRM>
</body>
</html>
";

            using (var content = StreamContentFactory.FromHtml(Html))
            {
                var page = new HtmlPageWrapper();

                page.AssignContent(content);

                var actual = page.Find <AnyHtmlElement>().ByTagName("form");

                actual.Id.Should().Be("test");
            }
        }
Example #3
0
        public void ProcessesContentWithCaseInsensitiveAttributeNamesTest()
        {
            const string Html = @"
<html>
<body>
<FORm Name='test'></FORm>
</body>
</html>
";

            using (var content = StreamContentFactory.FromHtml(Html))
            {
                var page = new HtmlPageWrapper();

                page.AssignContent(content);

                var actual = page.Find <AnyHtmlElement>().AllByAttribute("name", "test");

                actual.Count().Should().Be(1);
            }
        }
Example #4
0
        public void ProcessesContentWithCaseInsensitiveAttributeValuesTest()
        {
            const string Html = @"
            <html>
            <body>
            <form name='test'>
            <input type='Submit' name='Login' value='Submit' />
            </form>
            </body>
            </html>
            ";

            using (var content = StreamContentFactory.FromHtml(Html))
            {
                var page = new HtmlPageWrapper();

                page.AssignContent(content);

                var actual = page.Find<HtmlButton>().ByName("login");

                actual.Value.Should().Be("Submit");
            }
        }
Example #5
0
        public void ProcessesContentWithCaseInsensitiveAttributeValuesTest()
        {
            const string Html = @"
<html>
<body>
<form name='test'>
<input type='Submit' name='Login' value='Submit' />
</form>
</body>
</html>
";

            using (var content = StreamContentFactory.FromHtml(Html))
            {
                var page = new HtmlPageWrapper();

                page.AssignContent(content);

                var actual = page.Find <HtmlButton>().ByName("login");

                actual.Value.Should().Be("Submit");
            }
        }
Example #6
0
        public void ProcessesContentWithCaseInsensitiveTagNamesTest()
        {
            const string Html = @"
            <html>
            <body>
            <FORm id='test'></FORm>
            </body>
            </html>
            ";

            using (var content = StreamContentFactory.FromHtml(Html))
            {
                var page = new HtmlPageWrapper();

                page.AssignContent(content);

                var actual = page.Find<AnyHtmlElement>().ByTagName("form");

                actual.Id.Should().Be("test");
            }
        }