public void Should_Read_Empty_File_Correct()
            {
                // Given
                var fixture =
                    new MarkdownlintIssuesProviderFixture <MarkdownlintCliLogFileFormat>("empty.log");

                // When
                var issues = fixture.ReadIssues().ToList();

                // Then
                issues.ShouldBeEmpty();
            }
            public void Should_Read_Issue_MD034_Correct()
            {
                // Given
                var fixture =
                    new MarkdownlintIssuesProviderFixture <MarkdownlintCliJsonLogFileFormat>("MD034.json");

                // When
                var issues = fixture.ReadIssues().ToList();

                // Then
                issues.Count.ShouldBe(1);
                IssueChecker.Check(
                    issues[0],
                    IssueBuilder.NewIssue(
                        "Bare URL used",
                        "Cake.Issues.Markdownlint.MarkdownlintIssuesProvider",
                        "markdownlint")
                    .InFile("docs/report-formats/sarif/release-notes.md", 139, 139, 6, 74)
                    .OfRule("MD034", new Uri("https://github.com/DavidAnson/markdownlint/blob/v0.23.1/doc/Rules.md#md034"))
                    .WithPriority(IssuePriority.Warning));
            }
            public void Should_Read_Issue_MD025_Correct()
            {
                // Given
                var fixture =
                    new MarkdownlintIssuesProviderFixture <MarkdownlintCliJsonLogFileFormat>("MD025.json");

                // When
                var issues = fixture.ReadIssues().ToList();

                // Then
                issues.Count.ShouldBe(1);
                IssueChecker.Check(
                    issues[0],
                    IssueBuilder.NewIssue(
                        "Multiple top-level headings in the same document",
                        "Cake.Issues.Markdownlint.MarkdownlintIssuesProvider",
                        "markdownlint")
                    .InFile("docs/extending/issue-provider/helper.md", 13)
                    .OfRule("MD025", new Uri("https://github.com/DavidAnson/markdownlint/blob/v0.23.1/doc/Rules.md#md025"))
                    .WithPriority(IssuePriority.Warning));
            }
            public void Should_Read_Issue_MD013_Correct()
            {
                // Given
                var fixture =
                    new MarkdownlintIssuesProviderFixture <MarkdownlintCliJsonLogFileFormat>("MD013.json");

                // When
                var issues = fixture.ReadIssues().ToList();

                // Then
                issues.Count.ShouldBe(1);
                IssueChecker.Check(
                    issues[0],
                    IssueBuilder.NewIssue(
                        "Line length: Expected: 80; Actual: 124",
                        "Cake.Issues.Markdownlint.MarkdownlintIssuesProvider",
                        "markdownlint")
                    .InFile("docs/extending/fundamentals.md", 7, 7, 81, 125)
                    .OfRule("MD013", new Uri("https://github.com/DavidAnson/markdownlint/blob/v0.23.1/doc/Rules.md#md013"))
                    .WithPriority(IssuePriority.Warning));
            }
            public void Should_Read_Issues_Correct()
            {
                // Given
                var fixture = new MarkdownlintIssuesProviderFixture <MarkdownlintV1LogFileFormat>("markdownlint.json");

                // When
                var issues = fixture.ReadIssues().ToList();

                // Then
                issues.Count.ShouldBe(3);
                IssueChecker.Check(
                    issues[0],
                    IssueBuilder.NewIssue(
                        "Hard tabs",
                        "Cake.Issues.Markdownlint.MarkdownlintIssuesProvider",
                        "markdownlint")
                    .InFile("bad.md", 3)
                    .OfRule("MD010", new Uri("https://github.com/DavidAnson/markdownlint/blob/master/doc/Rules.md#md010"))
                    .WithPriority(IssuePriority.Warning));
                IssueChecker.Check(
                    issues[1],
                    IssueBuilder.NewIssue(
                        "No space after hash on atx style header",
                        "Cake.Issues.Markdownlint.MarkdownlintIssuesProvider",
                        "markdownlint")
                    .InFile("bad.md", 1)
                    .OfRule("MD018", new Uri("https://github.com/DavidAnson/markdownlint/blob/master/doc/Rules.md#md018"))
                    .WithPriority(IssuePriority.Warning));
                IssueChecker.Check(
                    issues[2],
                    IssueBuilder.NewIssue(
                        "No space after hash on atx style header",
                        "Cake.Issues.Markdownlint.MarkdownlintIssuesProvider",
                        "markdownlint")
                    .InFile("bad.md", 3)
                    .OfRule("MD018", new Uri("https://github.com/DavidAnson/markdownlint/blob/master/doc/Rules.md#md018"))
                    .WithPriority(IssuePriority.Warning));
            }
            public void Should_Read_Issue_With_Absolute_Path_Correct()
            {
                // Given
                var fixture =
                    new MarkdownlintIssuesProviderFixture <MarkdownlintCliJsonLogFileFormat>("AbsoluteFilePath.json")
                {
                    ReadIssuesSettings = new ReadIssuesSettings("/markdown"),
                };

                // When
                var issues = fixture.ReadIssues().ToList();

                // Then
                issues.Count.ShouldBe(1);
                IssueChecker.Check(
                    issues[0],
                    IssueBuilder.NewIssue(
                        "Headings should be surrounded by blank lines: Expected: 1; Actual: 0; Below",
                        "Cake.Issues.Markdownlint.MarkdownlintIssuesProvider",
                        "markdownlint")
                    .InFile("docs/input/index.md", 4)
                    .OfRule("MD022", new Uri("https://github.com/DavidAnson/markdownlint/blob/v0.23.1/doc/Rules.md#md022"))
                    .WithPriority(IssuePriority.Warning));
            }
            public void Should_Read_Issue_Correct_0_8_1()
            {
                // Given
                var fixture =
                    new MarkdownlintIssuesProviderFixture <MarkdownlintCliLogFileFormat>("markdownlint-cli-0.8.1.log");

                // When
                var issues = fixture.ReadIssues().ToList();

                // Then
                issues.Count.ShouldBe(8);
                IssueChecker.Check(
                    issues[0],
                    IssueBuilder.NewIssue(
                        "Headers should be surrounded by blank lines [Context: \"# foo\"]",
                        "Cake.Issues.Markdownlint.MarkdownlintIssuesProvider",
                        "markdownlint")
                    .InFile("docs/index.md", 1)
                    .OfRule("MD022", new Uri("https://github.com/DavidAnson/markdownlint/blob/master/doc/Rules.md#md022"))
                    .WithPriority(IssuePriority.Warning));
                IssueChecker.Check(
                    issues[1],
                    IssueBuilder.NewIssue(
                        "Trailing spaces [Expected: 2; Actual: 1]",
                        "Cake.Issues.Markdownlint.MarkdownlintIssuesProvider",
                        "markdownlint")
                    .InFile("docs/index.md", 2)
                    .OfRule("MD009", new Uri("https://github.com/DavidAnson/markdownlint/blob/master/doc/Rules.md#md009"))
                    .WithPriority(IssuePriority.Warning));
                IssueChecker.Check(
                    issues[2],
                    IssueBuilder.NewIssue(
                        "Line length [Expected: 100; Actual: 811]",
                        "Cake.Issues.Markdownlint.MarkdownlintIssuesProvider",
                        "markdownlint")
                    .InFile("docs/index.md", 2)
                    .OfRule("MD013", new Uri("https://github.com/DavidAnson/markdownlint/blob/master/doc/Rules.md#md013"))
                    .WithPriority(IssuePriority.Warning));
                IssueChecker.Check(
                    issues[3],
                    IssueBuilder.NewIssue(
                        "Headers should be surrounded by blank lines [Context: \"# bar\"]",
                        "Cake.Issues.Markdownlint.MarkdownlintIssuesProvider",
                        "markdownlint")
                    .InFile("docs/index.md", 4)
                    .OfRule("MD022", new Uri("https://github.com/DavidAnson/markdownlint/blob/master/doc/Rules.md#md022"))
                    .WithPriority(IssuePriority.Warning));
                IssueChecker.Check(
                    issues[4],
                    IssueBuilder.NewIssue(
                        "Multiple top level headers in the same document [Context: \"# bar\"]",
                        "Cake.Issues.Markdownlint.MarkdownlintIssuesProvider",
                        "markdownlint")
                    .InFile("docs/index.md", 4)
                    .OfRule("MD025", new Uri("https://github.com/DavidAnson/markdownlint/blob/master/doc/Rules.md#md025"))
                    .WithPriority(IssuePriority.Warning));
                IssueChecker.Check(
                    issues[5],
                    IssueBuilder.NewIssue(
                        "Fenced code blocks should be surrounded by blank lines [Context: \"```\"]",
                        "Cake.Issues.Markdownlint.MarkdownlintIssuesProvider",
                        "markdownlint")
                    .InFile("docs/index.md", 5)
                    .OfRule("MD031", new Uri("https://github.com/DavidAnson/markdownlint/blob/master/doc/Rules.md#md031"))
                    .WithPriority(IssuePriority.Warning));
                IssueChecker.Check(
                    issues[6],
                    IssueBuilder.NewIssue(
                        "Fenced code blocks should have a language specified [Context: \"```\"]",
                        "Cake.Issues.Markdownlint.MarkdownlintIssuesProvider",
                        "markdownlint")
                    .InFile("docs/index.md", 5)
                    .OfRule("MD040", new Uri("https://github.com/DavidAnson/markdownlint/blob/master/doc/Rules.md#md040"))
                    .WithPriority(IssuePriority.Warning));
                IssueChecker.Check(
                    issues[7],
                    IssueBuilder.NewIssue(
                        "Trailing spaces [Expected: 2; Actual: 1]",
                        "Cake.Issues.Markdownlint.MarkdownlintIssuesProvider",
                        "markdownlint")
                    .InFile("docs/index.md", 6)
                    .OfRule("MD009", new Uri("https://github.com/DavidAnson/markdownlint/blob/master/doc/Rules.md#md009"))
                    .WithPriority(IssuePriority.Warning));
            }