public void GetTags_HasSelectedIssueLocationTags_ReturnsExpectedAdornmentTags() { 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 IssueLocationAdornmentTagger(aggregator, viewMock); // Act var actual = testSubject.GetTags(inputSpans).ToArray(); actual.Length.Should().Be(2); actual[0].Span.Span.Start.Should().Be(selectedLoc1.Span.Value.Span.Start); actual[1].Span.Span.Start.Should().Be(selectedLoc2.Span.Value.Span.Start); actual[0].Span.Span.Length.Should().Be(0); actual[1].Span.Span.Length.Should().Be(0); var adornment1 = actual[0].Tag.Adornment as IssueLocationAdornment; adornment1.Should().NotBeNull(); adornment1.LocationViz.Should().Be(selectedLoc1); var adornment2 = actual[1].Tag.Adornment as IssueLocationAdornment; adornment2.Should().NotBeNull(); adornment2.LocationViz.Should().Be(selectedLoc2); }
public void GetTags_NoSelectedIssueLocationTags_ReturnsEmpty() { var snapshot = CreateSnapshot(length: 50); var inputSpans = CreateSpanCollectionSpanningWholeSnapshot(snapshot); var aggregator = CreateSelectedIssueAggregator(); var viewMock = CreateWpfTextView(snapshot); var testSubject = new IssueLocationAdornmentTagger(aggregator, viewMock); // Act testSubject.GetTags(inputSpans) .Should().BeEmpty(); }