コード例 #1
0
        public void WhenSupressionsUpdated_AnalysisIsRequested()
        {
            var builder = new TestEnvironmentBuilder(SonarLintMode.Connected);

            builder.SimulateSuppressionsUpdated();

            builder.AssertAnalysisIsRequested();
            builder.Logger.AssertOutputStringExists(AnalysisStrings.ConfigMonitor_SuppressionsUpdated);
        }
コード例 #2
0
        public void WhenSuppressionsUpdated_HasSubscribersToConfigChangedEvent_SubscribersNotified()
        {
            var builder      = new TestEnvironmentBuilder(SonarLintMode.Connected);
            var eventHandler = new Mock <EventHandler>();

            builder.TestSubject.ConfigChanged += eventHandler.Object;

            builder.SimulateSuppressionsUpdated();

            eventHandler.Verify(x => x(builder.TestSubject, EventArgs.Empty), Times.Once);
        }
コード例 #3
0
        public void WhenDisposed_EventsAreIgnored(SonarLintMode bindingMode)
        {
            var builder = new TestEnvironmentBuilder(bindingMode);

            // Act
            builder.TestSubject.Dispose();

            // Raise events and check they are ignored
            builder.SimulateSuppressionsUpdated();
            builder.SimulateUserSettingsChanged();

            builder.AssertAnalysisIsNotRequested();
        }