Пример #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);
            }
        }
Пример #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");
            }
        }
Пример #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);
            }
        }
Пример #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");
            }
        }
Пример #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");
            }
        }
Пример #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");
            }
        }