public void HeaderTitle() { IDocument doc = CreateDocument(@"<!doctype html> <html> <head> <title>A B C</title> <!-- InstanceBeginEditable name=""head"" --> <!-- InstanceEndEditable --> </head> <body> <main> <article> <header> <h1><!-- InstanceBeginEditable name=""TitleDerived"" -->Title goes here<!-- InstanceEndEditable --></h1> </header> <article> <main> </body> </html>"); var pageFixer = new PageFixer(doc); pageFixer.fixTitle(); doc.QuerySelector("h1").TextContent.Should().Be("A B C"); }
public void OpenGraphTitle() { IDocument doc = CreateDocument(@"<!doctype html> <html> <head> <title>A B C</title> <!-- InstanceBeginEditable name=""head"" --> <!-- InstanceEndEditable --> </head> <body> <main> <article> <header> <h1><!-- InstanceBeginEditable name=""TitleDerived"" -->Title goes here<!-- InstanceEndEditable --></h1> </header> <article> <main> </body> </html>"); var pageFixer = new PageFixer(doc); pageFixer.fixTitle(); doc.QuerySelector("head meta[property = 'og:title']").Attributes["content"].Value.Should().Be("A B C"); }