protected void ExecuteTest(IHtmlRule rule, string bodyHtml) { XmlDocument document = GetDocument(bodyHtml); XmlNamespaceManager namespaceManager = GetNamespaceManager(document); _errors = rule.ValidateHtml(document, namespaceManager); }
protected static void AssertHtmlRulePasses(IHtmlRule htmlRule, string bodyHtml) { var document = GetDocument(bodyHtml); var records = htmlRule.ValidateHtml(document, GetNamespaceManager(document)); Assert.That(records.Length, Is.EqualTo(0)); }
protected static void AssertHtmlRuleFails(IHtmlRule htmlRule, string bodyHtml, int lineNumber, int linePosition, string message) { XmlDocument document = GetDocument(bodyHtml); XmlNamespaceManager namespaceManager = GetNamespaceManager(document); IHtmlRule rule = htmlRule; var records = rule.ValidateHtml(document, namespaceManager); Assert.That(records.Length, Is.EqualTo(1)); Assert.That(records[0].Message, Is.EqualTo(message)); }