public void should_have_matching_tags_if_present(string article) { using (var sr = new StreamReader(article)) { var articleSource = sr.ReadToEnd(); var beginTags = new Regex(Regex.Escape("@Tags")).Matches(articleSource).Count; var endTags = new Regex(Regex.Escape("@EndTags")).Matches(articleSource).Count; beginTags.ShouldBeEquivalentTo(endTags); } }
public void should_have_matching_sections(string article) { using (var sr = new StreamReader(article)) { var articleSource = sr.ReadToEnd(); var beginSection = new Regex(Regex.Escape("@Section")).Matches(articleSource).Count; var endSection = new Regex(Regex.Escape("@EndSection")).Matches(articleSource).Count; beginSection.ShouldBeEquivalentTo(endSection); } }