示例#1
0
 public bool PropertyApplied_DoesNotThrow(string htmlFile, string cssFile, string property, string value)
 {
     using (var html = new AutoCheck.Core.Connectors.Html(GetSampleFile("html", htmlFile)))
         using (var css = new AutoCheck.Core.Connectors.Css(GetSampleFile(cssFile)))
         {
             return(css.PropertyApplied(html.HtmlDoc, property, value));
         }
 }
示例#2
0
 public int CountNodes_DoesNotThrow(string file, string xpath)
 {
     //Internally uses SelectNodes
     using (var conn = new AutoCheck.Core.Connectors.Html(GetSampleFile(file)))
         return(conn.CountNodes(xpath));
 }
示例#3
0
 public void ValidateHtml5AgainstW3C_DoesNotThrow(string file)
 {
     using (var conn = new AutoCheck.Core.Connectors.Html(GetSampleFile(file)))
         Assert.DoesNotThrow(() => conn.ValidateHtml5AgainstW3C());
 }
示例#4
0
 public void ValidateHtml5AgainstW3C_Throws_DocumentInvalidException(string file)
 {
     using (var conn = new AutoCheck.Core.Connectors.Html(GetSampleFile(file)))
         Assert.Throws <DocumentInvalidException>(() => conn.ValidateHtml5AgainstW3C());
 }
示例#5
0
 public void CheckTableConsistence_DoesNotThrow(string file, string xpath)
 {
     using (var conn = new AutoCheck.Core.Connectors.Html(GetSampleFile(file)))
         Assert.DoesNotThrow(() => conn.ValidateTable(xpath));
 }
示例#6
0
 public void CheckTableConsistence_Throws_TableInconsistencyException(string file, string xpath)
 {
     //TODO: check for rowspan consistency
     using (var conn = new AutoCheck.Core.Connectors.Html(GetSampleFile(file)))
         Assert.Throws <TableInconsistencyException>(() => conn.ValidateTable(xpath));
 }
示例#7
0
 public int[] GetRelatedLabels_DoesNotThrow(string file, string xpath)
 {
     using (var conn = new AutoCheck.Core.Connectors.Html(GetSampleFile(file)))
         return(conn.GetRelatedLabels(xpath).Select(x => x.Value.Count()).ToArray());
 }
示例#8
0
 public int ContentLength_DoesNotThrow(string file, string xpath)
 {
     using (var conn = new AutoCheck.Core.Connectors.Html(GetSampleFile(file)))
         return(conn.ContentLength(xpath));
 }
示例#9
0
 public int[] CountSiblings_DoesNotThrow(string file, string xpath)
 {
     //Internally uses GroupSiblings
     using (var conn = new AutoCheck.Core.Connectors.Html(GetSampleFile(file)))
         return(conn.CountSiblings(xpath));
 }