public void GetAnalysisSettings_WhenConfigIsNull_ThrowsArgumentNullException()
        {
            // Arrange
            Action action = () => ConfigSettingsExtensions.GetAnalysisSettings(null, false);

            // Act & Assert
            action.ShouldThrowExactly <ArgumentNullException>().And.ParamName.Should().Be("config");
        }
Exemple #2
0
        private static IAnalysisPropertyProvider GetAnalysisSettingsIsolatedFromEnvironment(AnalysisConfig config, bool includeServerSettings)
        {
            IAnalysisPropertyProvider provider = null;

            // Make sure the test isn't affected by the hosting environment
            // The SonarCloud VSTS extension sets additional properties in an environment variable that
            // would affect the test
            using (var scope = new EnvironmentVariableScope())
            {
                scope.SetVariable(EnvScannerPropertiesProvider.ENV_VAR_KEY, null);

                provider = ConfigSettingsExtensions.GetAnalysisSettings(config, includeServerSettings);
            }

            return(provider);
        }