Example #1
0
        public void GetLocationsVizForFile_NoMatches_ReturnsEmpty()
        {
            var issue1 = CreateIssueWithSpecificsPaths("path1.txt");
            var issues = new[] { issue1 };

            var testSubject = new IssuesSnapshot(ValidProjectName, ValidProjectGuid, ValidFilePath, issues);

            var actual = testSubject.GetLocationsVizsForFile("xxx");

            actual.Should().BeEmpty();
        }
Example #2
0
        public void GetLocationsVizForFile_MatchesInPrimaryLocations_ReturnsExpected()
        {
            var issue1 = CreateIssueWithSpecificsPaths("path1.txt");
            var issue2 = CreateIssueWithSpecificsPaths("XXX.txt");
            var issue3 = CreateIssueWithSpecificsPaths("path1.txt");
            var issues = new[] { issue1, issue2, issue3 };

            var testSubject = new IssuesSnapshot(ValidProjectName, ValidProjectGuid, ValidFilePath, issues);

            var actual = testSubject.GetLocationsVizsForFile("path1.txt");

            actual.Should().BeEquivalentTo(issue1, issue3);
        }
Example #3
0
        public void GetLocationsVizForFile_MatchesInSecondaryLocations_ReturnsExpected()
        {
            var flow1 = CreateFlowViz("match.txt", "MATCH.TXT");
            var flow2 = CreateFlowViz("miss.txt", "Match.txt");
            var flow3 = CreateFlowViz("another miss.txt");

            var issue1 = CreateIssueWithSpecificsPaths("path1.txt", flow1, flow2, flow3);
            var issues = new[] { issue1 };

            var testSubject = new IssuesSnapshot(ValidProjectName, ValidProjectGuid, ValidFilePath, issues);

            var actual = testSubject.GetLocationsVizsForFile("match.txt");

            actual.Should().BeEquivalentTo(flow1.Locations[0], flow1.Locations[1], flow2.Locations[1]);
        }