public SelectionChangedEventArgs(SelectionChangeLevel selectionChangeLevel, IAnalysisIssueVisualization selectedIssue, IAnalysisIssueFlowVisualization selectedFlow, IAnalysisIssueLocationVisualization selectedLocation) { SelectedIssue = selectedIssue; SelectedFlow = selectedFlow; SelectedLocation = selectedLocation; SelectionChangeLevel = selectionChangeLevel; }
private void RaiseSelectionChangedEvent(SelectionChangeLevel changeLevel, IAnalysisIssueVisualization issue = null, IAnalysisIssueFlowVisualization flow = null, IAnalysisIssueLocationVisualization location = null) { selectionServiceMock.Raise(x => x.SelectionChanged += null, new SelectionChangedEventArgs(changeLevel, issue, flow, location)); }
public void OnSelectionChanged_ChangeLevelIsNotLocation_EditorIsNotified(SelectionChangeLevel changeLevel) { var selectionServiceMock = new Mock <IAnalysisIssueSelectionService>(); var testSubject = new SelectedIssueLocationTagger(ValidAggregator, ValidBuffer, selectionServiceMock.Object); var tagsChangedEventCount = 0; SnapshotSpanEventArgs actualEventArgs = null; testSubject.TagsChanged += (sender, args) => { tagsChangedEventCount++; actualEventArgs = args; }; // Act selectionServiceMock.Raise(x => x.SelectionChanged += null, new SelectionChangedEventArgs(changeLevel, null, null, null)); tagsChangedEventCount.Should().Be(1); actualEventArgs.Should().NotBeNull(); actualEventArgs.Span.Start.Position.Should().Be(0); actualEventArgs.Span.End.Position.Should().Be(ValidBuffer.CurrentSnapshot.Length); actualEventArgs.Span.Snapshot.Should().Be(ValidBuffer.CurrentSnapshot); }