public void CorrectTitle(string title)
        {
            string invalidStart;
            var    result = TitleCasing.IsCamelCase(title, out invalidStart);

            Assert.True(result, $"Title '{title}' should be recognized as valid camel case (invalid: '{invalidStart}')");
        }
Exemple #2
0
 public void Check(Page page, ErrorReporter reporter)
 {
     if (!TitleCasing.IsCamelCase(page.Title))
     {
         reporter.Report(page, "Page title is not camel case");
     }
 }
        public void Check(Page page, ErrorReporter reporter)
        {
            var doc = JsonConvert.DeserializeObject <AtlasItem>(page.Body.AtlasDocFormat.Value);

            var headings = doc.Descendants().Where(x => x.Type == "heading");

            foreach (var heading in headings)
            {
                var texts = heading.Descendants().Where(x => x.Type == "text").Select(x => x.Text);

                var text = string.Join(" ", texts);

                if (!TitleCasing.IsCamelCase(text))
                {
                    reporter.Report(page, $"Heading '{text}' is not camel case");
                }
            }
        }
        public void IncorrectTitle(string title)
        {
            var result = TitleCasing.IsCamelCase(title);

            Assert.False(result, $"Title '{title}' should be recognized as invalid camel case");
        }