예제 #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 WhenUserSettingsChange(SonarLintMode bindingMode, bool shouldAnalysisBeRequested)
        {
            var builder = new TestEnvironmentBuilder(bindingMode);

            builder.SimulateUserSettingsChanged();

            if (shouldAnalysisBeRequested)
            {
                builder.AssertAnalysisIsRequested();
                builder.Logger.AssertOutputStringExists(AnalysisStrings.ConfigMonitor_UserSettingsChanged);
            }
            else
            {
                builder.AssertAnalysisIsNotRequested();
                builder.Logger.AssertOutputStringExists(AnalysisStrings.ConfigMonitor_IgnoringUserSettingsChanged);
            }
        }
        public void WhenBindingIsChanged(SonarLintMode bindingMode, bool shouldAnalysisBeRequested)
        {
            var builder = new TestEnvironmentBuilder(bindingMode);

            builder.SimulateBindingChanged();

            if (shouldAnalysisBeRequested)
            {
                builder.AssertAnalysisIsRequested();
                builder.Logger.AssertOutputStringExists(AnalysisStrings.ConfigMonitor_SolutionBound);
            }
            else
            {
                builder.AssertAnalysisIsNotRequested();
                builder.Logger.AssertNoOutputMessages();
            }
        }
예제 #4
0
        public void WhenUserSettingsChange_AnalysisIsRequested(SonarLintMode bindingMode)
        {
            var builder = new TestEnvironmentBuilder(bindingMode);

            builder.SimulateUserSettingsChanged();

            // Should always re-analyse
            builder.AssertAnalysisIsRequested();
            builder.Logger.AssertOutputStringExists(AnalysisStrings.ConfigMonitor_UserSettingsChanged);

            if (bindingMode == SonarLintMode.Standalone)
            {
                builder.Logger.AssertOutputStringDoesNotExist(AnalysisStrings.ConfigMonitor_UserSettingsIgnoredForConnectedModeLanguages);
            }
            else
            {
                builder.Logger.AssertOutputStringExists(AnalysisStrings.ConfigMonitor_UserSettingsIgnoredForConnectedModeLanguages);
            }
        }