public void DisplayText_UsesCachedIssueRuleKey()
        {
            var selectedIssueMock = new Mock <IAnalysisIssueVisualization>();

            selectedIssueMock.Setup(x => x.RuleId).Returns("test rule id");

            var selectionServiceMock = new Mock <IIssueSelectionService>();

            selectionServiceMock.SetupGet(x => x.SelectedIssue).Returns(selectedIssueMock.Object);

            var testSubject = new DeselectIssueVisualizationAction(selectionServiceMock.Object);

            testSubject.DisplayText.Should().Contain("test rule id");

            selectionServiceMock.Reset();
            selectionServiceMock.SetupGet(x => x.SelectedIssue).Returns((IAnalysisIssueVisualization)null);

            testSubject.DisplayText.Should().Contain("test rule id");
        }
        public void Invoke_IssueIsDeselected()
        {
            var selectedIssueMock = new Mock <IAnalysisIssueVisualization>();

            selectedIssueMock.Setup(x => x.RuleId).Returns("test rule id");

            var selectionServiceMock = new Mock <IIssueSelectionService>();

            selectionServiceMock.SetupGet(x => x.SelectedIssue).Returns(selectedIssueMock.Object);
            selectionServiceMock.SetupSet(x => x.SelectedIssue = null);

            var testSubject = new DeselectIssueVisualizationAction(selectionServiceMock.Object);

            selectionServiceMock.VerifySet(x => x.SelectedIssue = It.IsAny <IAnalysisIssueVisualization>(), Times.Never());

            testSubject.Invoke(CancellationToken.None);

            selectionServiceMock.VerifySet(x => x.SelectedIssue = null, Times.Once());
        }