public void Identifies_link_with_different_URL_same_TEXT_same_NAME_as_Error() { var bodyHtml = new StringBuilder(); bodyHtml.Append(@"<a href=""/home2"" name=""name"">TestLink</a>"); bodyHtml.Append(@"<a href=""/home"" name=""name"">TestLink</a>"); bodyHtml.Append(@"<P/>"); var errors = new ContextOfLinkTextMustMakeSense().ValidateHtml(bodyHtml); errors.Length.ShouldEqual(1); }
public void Identifies_link_with_different_URL_same_TEXT_different_TITLE_as_No_Error() { var bodyHtml = new StringBuilder(); bodyHtml.Append(@"<a href=""/home2"" title=""title1"">TestLink</a>"); bodyHtml.Append(@"<a href=""/home"" title=""title"">TestLink</a>"); bodyHtml.Append(@"<P/>"); var errors = new ContextOfLinkTextMustMakeSense().ValidateHtml(bodyHtml); Assert.That(errors.Length, Is.EqualTo(0)); }
public void Identifies_link_with_different_URL_same_TEXT_one_of_them_missing_TITLE_as_No_Error() { var bodyHtml = new StringBuilder(); bodyHtml.Append(@"<a href=""/home2"" >TestLink</a>"); bodyHtml.Append(@"<a href=""/home"" title=""title"">TestLink</a>"); bodyHtml.Append(@"<P/>"); var errors = new ContextOfLinkTextMustMakeSense().ValidateHtml(bodyHtml); CollectionAssert.IsEmpty(errors); }
public void Identifies_link_with_missing_URL_same_TEXT_same_NAME_as_No_Error() { var bodyHtml = new StringBuilder(); bodyHtml.Append(@"<a name=""name"">TestLink</a>"); bodyHtml.Append(@"<a name=""name"">TestLink</a>"); bodyHtml.Append(@"<P/>"); var errors = new ContextOfLinkTextMustMakeSense().ValidateHtml(bodyHtml); CollectionAssert.IsEmpty(errors); }