Beispiel #1
0
        public void GetTags_NoSelectedIssueLocationTags_ReturnsEmpty()
        {
            var snapshot   = CreateSnapshot(length: 50);
            var inputSpans = CreateSpanCollectionSpanningWholeSnapshot(snapshot);

            var aggregator = CreateSelectedIssueAggregator();
            var viewMock   = CreateWpfTextView(snapshot);

            var testSubject = new IssueHighlightTagger(aggregator, viewMock);

            // Act
            testSubject.GetTags(inputSpans)
            .Should().BeEmpty();
        }
Beispiel #2
0
        public void GetTags_HasSelectedIssueLocationTags_ReturnsExpectedHighlightTags()
        {
            var snapshot   = CreateSnapshot(length: 50);
            var inputSpans = CreateSpanCollectionSpanningWholeSnapshot(snapshot);

            var selectedLoc1 = CreateLocationViz(snapshot, new Span(1, 5), "selection 1");
            var selectedLoc2 = CreateLocationViz(snapshot, new Span(20, 25), "selection 2");
            var aggregator   = CreateSelectedIssueAggregator(selectedLoc1, selectedLoc2);

            var viewMock = CreateWpfTextView(snapshot);

            var testSubject = new IssueHighlightTagger(aggregator, viewMock);

            // Act
            var actual = testSubject.GetTags(inputSpans).ToArray();

            actual.Length.Should().Be(2);
            actual[0].Span.Span.Should().Be(selectedLoc1.Span.Value.Span);
            actual[1].Span.Span.Should().Be(selectedLoc2.Span.Value.Span);
        }