Headless.UnitTests.HtmlElementFinderTests.ByPredicateReturnsMatchingElementTest C# (CSharp) Method

ByPredicateReturnsMatchingElementTest() private method

private ByPredicateReturnsMatchingElementTest ( ) : void
return void
        public void ByPredicateReturnsMatchingElementTest()
        {
            const string Html = @"
            <html>
            <head />
            <body>
            <form name='Test'>
            <input type='text' id='DataId' name='Data' />
            </form>
            <form name='SecondTest'>
            <input type='checkbox' name='IsSet' />
            </form>
            </body>
            </html>
            ";

            var page = new HtmlPageStub(Html);

            var form = page.Find<HtmlForm>().ByPredicate(x => x.Name == "SecondTest");

            form.Name.Should().Be("SecondTest");
        }
HtmlElementFinderTests