diff --git a/SonarQube.VisualStudio.sln b/SonarQube.VisualStudio.sln
index 15071cab56..1eeb518fb7 100644
--- a/SonarQube.VisualStudio.sln
+++ b/SonarQube.VisualStudio.sln
@@ -22,6 +22,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
Directory.Build.props = Directory.Build.props
Directory.Build.targets = Directory.Build.targets
nuget.config = nuget.config
+ src\RoslynAnalyzerServer\RoslynAnalyzerServer.csproj = src\RoslynAnalyzerServer\RoslynAnalyzerServer.csproj
SonarLint.VsTargetVersion.props = SonarLint.VsTargetVersion.props
EndProjectSection
EndProject
@@ -81,12 +82,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CFamily", "src\CFamily\CFam
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CFamily.UnitTests", "src\CFamily.UnitTests\CFamily.UnitTests.csproj", "{30E1FF8F-94BA-4A39-A737-8FFD7B4A0CD3}"
EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Roslyn.Suppressions", "Roslyn.Suppressions", "{16BF2D77-AE3B-4218-A3E8-875829D73B00}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Roslyn.Suppressions", "src\Roslyn.Suppressions\Roslyn.Suppressions\Roslyn.Suppressions.csproj", "{082D5D8E-F914-4139-9AE3-3F48B679E3DA}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Roslyn.Suppressions.UnitTests", "src\Roslyn.Suppressions\Roslyn.Suppressions.UnitTests\Roslyn.Suppressions.UnitTests.csproj", "{C478DAE7-58BC-4D02-929E-E413B40F2517}"
-EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ConnectedMode", "ConnectedMode", "{3B4A8B40-9821-4964-8EAB-1D8A0B078292}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ConnectedMode", "src\ConnectedMode\ConnectedMode.csproj", "{0BE551DB-3C46-42A5-BB38-DA80E83F8ABD}"
@@ -134,6 +129,14 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CopyDependencies", "build\C
{3ECCAF9D-3B23-4980-83E2-8ACEE0FC6BEB} = {3ECCAF9D-3B23-4980-83E2-8ACEE0FC6BEB}
EndProjectSection
EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "RoslynAnalyzerServer", "RoslynAnalyzerServer", "{02EA681E-C7D8-13C7-8484-4AC65E1B71E8}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RoslynAnalyzerServer", "src\RoslynAnalyzerServer\RoslynAnalyzerServer.csproj", "{7EDBF3B2-2820-4C35-A368-CE3213F0BBE4}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RoslynAnalyzerServer.UnitTests", "src\RoslynAnalyzerServer.UnitTests\RoslynAnalyzerServer.UnitTests.csproj", "{754189A4-1458-4F0C-9D1A-E4F359B66E37}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RoslynAnalyzerServer.IntegrationTests", "src\RoslynAnalyzerServer.IntegrationTests\RoslynAnalyzerServer.IntegrationTests.csproj", "{DCC4771A-C097-4B46-B1EB-39C3E13C6252}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -262,22 +265,6 @@ Global
{30E1FF8F-94BA-4A39-A737-8FFD7B4A0CD3}.Release|Any CPU.Build.0 = Release|Any CPU
{30E1FF8F-94BA-4A39-A737-8FFD7B4A0CD3}.Release|x86.ActiveCfg = Release|Any CPU
{30E1FF8F-94BA-4A39-A737-8FFD7B4A0CD3}.Release|x86.Build.0 = Release|Any CPU
- {082D5D8E-F914-4139-9AE3-3F48B679E3DA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {082D5D8E-F914-4139-9AE3-3F48B679E3DA}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {082D5D8E-F914-4139-9AE3-3F48B679E3DA}.Debug|x86.ActiveCfg = Debug|Any CPU
- {082D5D8E-F914-4139-9AE3-3F48B679E3DA}.Debug|x86.Build.0 = Debug|Any CPU
- {082D5D8E-F914-4139-9AE3-3F48B679E3DA}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {082D5D8E-F914-4139-9AE3-3F48B679E3DA}.Release|Any CPU.Build.0 = Release|Any CPU
- {082D5D8E-F914-4139-9AE3-3F48B679E3DA}.Release|x86.ActiveCfg = Release|Any CPU
- {082D5D8E-F914-4139-9AE3-3F48B679E3DA}.Release|x86.Build.0 = Release|Any CPU
- {C478DAE7-58BC-4D02-929E-E413B40F2517}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {C478DAE7-58BC-4D02-929E-E413B40F2517}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {C478DAE7-58BC-4D02-929E-E413B40F2517}.Debug|x86.ActiveCfg = Debug|Any CPU
- {C478DAE7-58BC-4D02-929E-E413B40F2517}.Debug|x86.Build.0 = Debug|Any CPU
- {C478DAE7-58BC-4D02-929E-E413B40F2517}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {C478DAE7-58BC-4D02-929E-E413B40F2517}.Release|Any CPU.Build.0 = Release|Any CPU
- {C478DAE7-58BC-4D02-929E-E413B40F2517}.Release|x86.ActiveCfg = Release|Any CPU
- {C478DAE7-58BC-4D02-929E-E413B40F2517}.Release|x86.Build.0 = Release|Any CPU
{0BE551DB-3C46-42A5-BB38-DA80E83F8ABD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0BE551DB-3C46-42A5-BB38-DA80E83F8ABD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0BE551DB-3C46-42A5-BB38-DA80E83F8ABD}.Debug|x86.ActiveCfg = Debug|Any CPU
@@ -382,6 +369,30 @@ Global
{2BB16C6F-BF06-4225-99A0-F1CFE70CBE44}.Release|Any CPU.Build.0 = Debug|x86
{2BB16C6F-BF06-4225-99A0-F1CFE70CBE44}.Release|x86.ActiveCfg = Debug|x86
{2BB16C6F-BF06-4225-99A0-F1CFE70CBE44}.Release|x86.Build.0 = Debug|x86
+ {7EDBF3B2-2820-4C35-A368-CE3213F0BBE4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {7EDBF3B2-2820-4C35-A368-CE3213F0BBE4}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {7EDBF3B2-2820-4C35-A368-CE3213F0BBE4}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {7EDBF3B2-2820-4C35-A368-CE3213F0BBE4}.Debug|x86.Build.0 = Debug|Any CPU
+ {7EDBF3B2-2820-4C35-A368-CE3213F0BBE4}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {7EDBF3B2-2820-4C35-A368-CE3213F0BBE4}.Release|Any CPU.Build.0 = Release|Any CPU
+ {7EDBF3B2-2820-4C35-A368-CE3213F0BBE4}.Release|x86.ActiveCfg = Release|Any CPU
+ {7EDBF3B2-2820-4C35-A368-CE3213F0BBE4}.Release|x86.Build.0 = Release|Any CPU
+ {754189A4-1458-4F0C-9D1A-E4F359B66E37}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {754189A4-1458-4F0C-9D1A-E4F359B66E37}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {754189A4-1458-4F0C-9D1A-E4F359B66E37}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {754189A4-1458-4F0C-9D1A-E4F359B66E37}.Debug|x86.Build.0 = Debug|Any CPU
+ {754189A4-1458-4F0C-9D1A-E4F359B66E37}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {754189A4-1458-4F0C-9D1A-E4F359B66E37}.Release|Any CPU.Build.0 = Release|Any CPU
+ {754189A4-1458-4F0C-9D1A-E4F359B66E37}.Release|x86.ActiveCfg = Release|Any CPU
+ {754189A4-1458-4F0C-9D1A-E4F359B66E37}.Release|x86.Build.0 = Release|Any CPU
+ {DCC4771A-C097-4B46-B1EB-39C3E13C6252}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {DCC4771A-C097-4B46-B1EB-39C3E13C6252}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {DCC4771A-C097-4B46-B1EB-39C3E13C6252}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {DCC4771A-C097-4B46-B1EB-39C3E13C6252}.Debug|x86.Build.0 = Debug|Any CPU
+ {DCC4771A-C097-4B46-B1EB-39C3E13C6252}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {DCC4771A-C097-4B46-B1EB-39C3E13C6252}.Release|Any CPU.Build.0 = Release|Any CPU
+ {DCC4771A-C097-4B46-B1EB-39C3E13C6252}.Release|x86.ActiveCfg = Release|Any CPU
+ {DCC4771A-C097-4B46-B1EB-39C3E13C6252}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -404,8 +415,6 @@ Global
{407919AF-3AEA-483D-9183-1063EDECDBC3} = {BE58232B-BE46-4D0D-9175-6BE0517F3EF0}
{58619C0F-0F3D-4E8C-B204-A19B332D45E5} = {11D4BFC7-C1F2-45AC-888E-25A6A216AD1D}
{30E1FF8F-94BA-4A39-A737-8FFD7B4A0CD3} = {11D4BFC7-C1F2-45AC-888E-25A6A216AD1D}
- {082D5D8E-F914-4139-9AE3-3F48B679E3DA} = {16BF2D77-AE3B-4218-A3E8-875829D73B00}
- {C478DAE7-58BC-4D02-929E-E413B40F2517} = {16BF2D77-AE3B-4218-A3E8-875829D73B00}
{0BE551DB-3C46-42A5-BB38-DA80E83F8ABD} = {3B4A8B40-9821-4964-8EAB-1D8A0B078292}
{2BD38A3A-6F0E-452B-A5B2-200113A32184} = {3B4A8B40-9821-4964-8EAB-1D8A0B078292}
{67BEB251-4EA5-44EE-92A7-B4F57D9A6867} = {25DE7210-DFC0-448B-894E-84C1C9CA223E}
@@ -422,6 +431,9 @@ Global
{1625398B-2343-481E-9B90-57B38EBEE8C5} = {236587E8-62A7-4E4E-815D-A50433859DC7}
{421D8026-2CBF-4444-A886-67428C1813E9} = {E93C2CF9-69A6-4669-BE8A-6060B18FEDCA}
{2BB16C6F-BF06-4225-99A0-F1CFE70CBE44} = {421D8026-2CBF-4444-A886-67428C1813E9}
+ {7EDBF3B2-2820-4C35-A368-CE3213F0BBE4} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
+ {754189A4-1458-4F0C-9D1A-E4F359B66E37} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
+ {DCC4771A-C097-4B46-B1EB-39C3E13C6252} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {DABC27C8-E761-4826-AD2D-056F677EF3C0}
diff --git a/SonarQube.VisualStudio.sln.DotSettings b/SonarQube.VisualStudio.sln.DotSettings
index 1c12bf3bca..5309ade584 100644
--- a/SonarQube.VisualStudio.sln.DotSettings
+++ b/SonarQube.VisualStudio.sln.DotSettings
@@ -25,6 +25,7 @@
False
True
CHOP_IF_LONG
+ True
True
True
CHOP_IF_LONG
diff --git a/THIRD-PARTY-NOTICES b/THIRD-PARTY-NOTICES
index 8ad9088d6c..252018b158 100644
--- a/THIRD-PARTY-NOTICES
+++ b/THIRD-PARTY-NOTICES
@@ -345,46 +345,6 @@ Apache License Version 2.0
END OF TERMS AND CONDITIONS
-
-License notice for Google Protobuf
------------------------------------------------------
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-Code generated by the Protocol Buffer compiler is owned by the owner
-of the input file used when generating it. This code is not
-standalone and requires a support library to be linked with it. This
-support library is itself covered by the above license.
-
-https://github.com/protocolbuffers/protobuf/blob/master/LICENSE
-
-
-License notice for GRPC
------------------------------------------------------
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-
-https://github.com/grpc/grpc/blob/master/LICENSE
-
-
License notice for Newtonsoft.Json
-----------------------------------------------------
The MIT License (MIT)
diff --git a/build/CopyDependencies/CopyDependencies.targets b/build/CopyDependencies/CopyDependencies.targets
index ed49120aad..167acdec68 100644
--- a/build/CopyDependencies/CopyDependencies.targets
+++ b/build/CopyDependencies/CopyDependencies.targets
@@ -37,6 +37,7 @@
+
diff --git a/build/DownloadDependencies/CommonProperties.props b/build/DownloadDependencies/CommonProperties.props
index e112a6389f..ed8603c2eb 100644
--- a/build/DownloadDependencies/CommonProperties.props
+++ b/build/DownloadDependencies/CommonProperties.props
@@ -58,6 +58,12 @@
$(JarDownloadDir)\$(SonarTextPluginFileName)
https://repox.jfrog.io/artifactory/sonarsource/org/sonarsource/text/sonar-text-plugin/$(EmbeddedSonarSecretsJarVersion)/$(SonarTextPluginFileName)
+
+
+ sonarqube-ide-visualstudio-roslyn-plugin-$(EmbeddedSonarSqvsRoslynJarVersion).jar
+ $(JarDownloadDir)\$(SonarSqvsRoslynPluginFileName)
+ https://repox.jfrog.io/artifactory/sonarsource/org/sonarsource/sonarlint/visualstudio/roslyn/sonarqube-ide-visualstudio-roslyn-plugin/$(EmbeddedSonarSqvsRoslynJarVersion)/$(SonarSqvsRoslynPluginFileName)
+
$(LOCALAPPDATA)\SLVS_Build_Dotnet
diff --git a/build/DownloadDependencies/JarProcessing.targets b/build/DownloadDependencies/JarProcessing.targets
index e75dbc19f8..efc113cce7 100644
--- a/build/DownloadDependencies/JarProcessing.targets
+++ b/build/DownloadDependencies/JarProcessing.targets
@@ -54,6 +54,7 @@
+
diff --git a/src/CFamily.UnitTests/packages.lock.json b/src/CFamily.UnitTests/packages.lock.json
index 975bb3b8e6..0da00f606f 100644
--- a/src/CFamily.UnitTests/packages.lock.json
+++ b/src/CFamily.UnitTests/packages.lock.json
@@ -116,16 +116,6 @@
"Microsoft.VisualStudio.Interop": "17.0.31902.203"
}
},
- "Google.Protobuf": {
- "type": "Transitive",
- "resolved": "3.6.1",
- "contentHash": "741fGeDQjixBJaU2j+0CbrmZXsNJkTn/hWbOh4fLVXndHsCclJmWznCPWrJmPoZKvajBvAz3e8ECJOUvRtwjNQ=="
- },
- "Grpc.Tools": {
- "type": "Transitive",
- "resolved": "1.4.1",
- "contentHash": "D5AcNr0yPFz5dqftJYKnMtwg6AEMUics+UysxTXKVuZtresqWUcHIrnscM+KsAIreG7wvdumWzjdIXRIMekCLg=="
- },
"MessagePack": {
"type": "Transitive",
"resolved": "2.2.85",
@@ -1260,7 +1250,7 @@
"SonarLint.VisualStudio.Integration": "[1.0.0, )",
"SonarLint.VisualStudio.IssueVisualization": "[1.0.0, )",
"SonarLint.VisualStudio.IssueVisualization.Security": "[1.0.0, )",
- "SonarLint.VisualStudio.Roslyn.Suppressions": "[1.0.0, )",
+ "SonarLint.VisualStudio.RoslynAnalyzerServer": "[1.0.0, )",
"SonarLint.VisualStudio.SLCore": "[1.0.0, )",
"SonarLint.VisualStudio.SLCore.Listeners": "[1.0.0, )",
"SonarQube.Client": "[1.0.0, )",
@@ -1376,16 +1366,10 @@
"SonarLint.VisualStudio.IssueVisualization": "[1.0.0, )"
}
},
- "SonarLint.VisualStudio.Roslyn.Suppressions": {
+ "SonarLint.VisualStudio.RoslynAnalyzerServer": {
"type": "Project",
"dependencies": {
- "Microsoft.VisualStudio.Sdk": "[17.0.31902.203, )",
- "Newtonsoft.Json": "[13.0.3, )",
- "SonarLint.VisualStudio.ConnectedMode": "[1.0.0, )",
- "SonarLint.VisualStudio.Core": "[1.0.0, )",
- "SonarLint.VisualStudio.Infrastructure.VS": "[1.0.0, )",
- "SonarQube.Client": "[1.0.0, )",
- "System.IO.Abstractions": "[9.0.4, )"
+ "SonarLint.VisualStudio.Core": "[1.0.0, )"
}
},
"SonarLint.VisualStudio.SLCore": {
@@ -1400,14 +1384,13 @@
"dependencies": {
"SonarLint.VisualStudio.ConnectedMode": "[1.0.0, )",
"SonarLint.VisualStudio.IssueVisualization.Security": "[1.0.0, )",
+ "SonarLint.VisualStudio.RoslynAnalyzerServer": "[1.0.0, )",
"SonarLint.VisualStudio.SLCore": "[1.0.0, )"
}
},
"sonarqube.client": {
"type": "Project",
"dependencies": {
- "Google.Protobuf": "[3.6.1, )",
- "Grpc.Tools": "[1.4.1, )",
"Newtonsoft.Json": "[13.0.3, )",
"SonarLint.VisualStudio.Core": "[1.0.0, )",
"System.Net.Http": "[4.0.0, )"
diff --git a/src/ConnectedMode.UnitTests/Binding/BindingProcessFactoryTests.cs b/src/ConnectedMode.UnitTests/Binding/BindingProcessFactoryTests.cs
deleted file mode 100644
index 3a4e745ca2..0000000000
--- a/src/ConnectedMode.UnitTests/Binding/BindingProcessFactoryTests.cs
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * SonarLint for Visual Studio
- * Copyright (C) 2016-2025 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-using System;
-using SonarLint.VisualStudio.ConnectedMode.Binding;
-using SonarLint.VisualStudio.ConnectedMode.QualityProfiles;
-using SonarLint.VisualStudio.Core;
-using SonarLint.VisualStudio.Core.Analysis;
-using SonarLint.VisualStudio.Core.Binding;
-using SonarLint.VisualStudio.TestInfrastructure;
-using SonarQube.Client;
-using SonarQube.Client.Models;
-
-namespace SonarLint.VisualStudio.ConnectedMode.UnitTests.Binding
-{
- [TestClass]
- public class BindingProcessFactoryTests
- {
- [TestMethod]
- public void MefCtor_CheckIsExported()
- {
- MefTestHelpers.CheckTypeCanBeImported(
- MefTestHelpers.CreateExport(),
- MefTestHelpers.CreateExport());
- }
-
- [TestMethod]
- public void Create_ReturnsProcessImpl()
- {
- var bindingArgs = new BindCommandArgs(new BoundServerProject("any", "any", new ServerConnection.SonarCloud("any")));
-
- var testSubject = CreateTestSubject();
-
- var actual = testSubject.Create(bindingArgs);
- actual.Should().Should().NotBeNull();
- actual.Should().BeOfType();
- }
-
- private static BindingProcessFactory CreateTestSubject(
- IQualityProfileDownloader qualityProfileDownloader = null,
- ILogger logger = null)
- {
- qualityProfileDownloader ??= Mock.Of();
- logger ??= new TestLogger(logToConsole: true);
-
- return new BindingProcessFactory(qualityProfileDownloader, logger);
- }
-
- }
-}
diff --git a/src/ConnectedMode.UnitTests/Binding/BindingProcessImplTests.cs b/src/ConnectedMode.UnitTests/Binding/BindingProcessImplTests.cs
deleted file mode 100644
index f82f1fd662..0000000000
--- a/src/ConnectedMode.UnitTests/Binding/BindingProcessImplTests.cs
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * SonarLint for Visual Studio
- * Copyright (C) 2016-2025 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-using System;
-using System.Threading;
-using System.Threading.Tasks;
-using SonarLint.VisualStudio.ConnectedMode.Binding;
-using SonarLint.VisualStudio.ConnectedMode.Persistence;
-using SonarLint.VisualStudio.ConnectedMode.QualityProfiles;
-using SonarLint.VisualStudio.Core;
-using SonarLint.VisualStudio.Core.Analysis;
-using SonarLint.VisualStudio.Core.Binding;
-using SonarLint.VisualStudio.TestInfrastructure;
-using SonarQube.Client;
-using SonarQube.Client.Helpers;
-using System.Security;
-
-namespace SonarLint.VisualStudio.ConnectedMode.UnitTests.Binding
-{
- [TestClass]
- public class BindingProcessImplTests
- {
- #region Tests
-
- [TestMethod]
- public void Ctor_ArgChecks()
- {
- var bindingArgs = CreateBindCommandArgs();
- var qpDownloader = Mock.Of();
- Mock.Of();
- var logger = Mock.Of();
-
- // 1. Null binding args
- Action act = () => new BindingProcessImpl(null, qpDownloader, logger);
- act.Should().ThrowExactly().And.ParamName.Should().Be("bindingArgs");
-
- // 2. Null QP downloader
- act = () => new BindingProcessImpl(bindingArgs, null, logger);
- act.Should().ThrowExactly().And.ParamName.Should().Be("qualityProfileDownloader");
-
- // 3. Null logger
- act = () => new BindingProcessImpl(bindingArgs, qpDownloader, null);
- act.Should().ThrowExactly().And.ParamName.Should().Be("logger");
- }
-
- [TestMethod]
- public async Task DownloadQualityProfile_CreatesBoundProjectAndCallsQPDownloader()
- {
- var qpDownloader = new Mock();
- var progress = Mock.Of>();
-
- var bindingArgs = CreateBindCommandArgs("the project key", "http://theServer");
-
- var testSubject = CreateTestSubject(bindingArgs,
- qpDownloader: qpDownloader.Object);
-
- // Act
- var result = await testSubject.DownloadQualityProfileAsync(progress, CancellationToken.None);
-
- result.Should().BeTrue();
-
- qpDownloader.Verify(x => x.UpdateAsync(It.IsAny(), progress, It.IsAny()),
- Times.Once);
-
- var actualProject = (BoundServerProject)qpDownloader.Invocations[0].Arguments[0];
-
- // Check the bound project was correctly constructed from the BindCommandArgs
- actualProject.Should().NotBeNull();
- actualProject.ServerConnection.ServerUri.Should().Be("http://theServer");
- actualProject.ServerProjectKey.Should().Be("the project key");
- }
-
- [TestMethod]
- public async Task DownloadQualityProfile_HandlesInvalidOperationException()
- {
- var qpDownloader = new Mock();
- qpDownloader
- .Setup(x =>
- x.UpdateAsync(It.IsAny(),
- It.IsAny>(),
- It.IsAny()))
- .Throws(new InvalidOperationException());
-
- var testSubject = CreateTestSubject(
- qpDownloader: qpDownloader.Object);
-
- // Act
- var result =
- await testSubject.DownloadQualityProfileAsync(Mock.Of>(), CancellationToken.None);
-
- result.Should().BeFalse();
- qpDownloader.Verify(x => x.UpdateAsync(It.IsAny(),
- It.IsAny>(),
- It.IsAny()),
- Times.Once);
- }
-
- #endregion Tests
-
- #region Helpers
-
- private BindingProcessImpl CreateTestSubject(BindCommandArgs bindingArgs = null,
- IQualityProfileDownloader qpDownloader = null,
- ILogger logger = null)
- {
- bindingArgs = bindingArgs ?? CreateBindCommandArgs();
- qpDownloader ??= Mock.Of();
- logger ??= new TestLogger(logToConsole: true);
-
- return new BindingProcessImpl(bindingArgs,
- qpDownloader,
- logger);
- }
-
- private BindCommandArgs CreateBindCommandArgs(string projectKey = "key", string serverUri = "http://any")
- {
- return new BindCommandArgs(new BoundServerProject("any", projectKey, new ServerConnection.SonarQube(new Uri(serverUri))));
- }
-
- private static void CheckIsExpectedPassword(string expectedRawPassword, SecureString actualPassword)
- {
- // The SecureString extension methods in SonarQube.Client.Helpers.SecureStringHelper throw for
- // nulls
- if (expectedRawPassword == null)
- {
- actualPassword.Should().BeNull();
- }
- else
- {
- actualPassword.ToUnsecureString().Should().Be(expectedRawPassword);
- }
- }
- #endregion Helpers
- }
-}
diff --git a/src/ConnectedMode.UnitTests/Binding/RoslynBindingConfigProviderTests.cs b/src/ConnectedMode.UnitTests/Binding/RoslynBindingConfigProviderTests.cs
deleted file mode 100644
index e3ca19e64f..0000000000
--- a/src/ConnectedMode.UnitTests/Binding/RoslynBindingConfigProviderTests.cs
+++ /dev/null
@@ -1,268 +0,0 @@
-/*
- * SonarLint for Visual Studio
- * Copyright (C) 2016-2025 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-using SonarLint.VisualStudio.ConnectedMode.Binding;
-using SonarLint.VisualStudio.ConnectedMode.QualityProfiles;
-using SonarLint.VisualStudio.Core;
-using SonarLint.VisualStudio.Core.Binding;
-using SonarLint.VisualStudio.Core.CSharpVB;
-using SonarLint.VisualStudio.TestInfrastructure;
-using SonarQube.Client;
-using SonarQube.Client.Models;
-using Language = SonarLint.VisualStudio.Core.Language;
-
-namespace SonarLint.VisualStudio.ConnectedMode.UnitTests.Binding;
-
-[TestClass]
-public class RoslynBindingConfigProviderTests
-{
- private IList validRules;
- private IList anyProperties;
- private SonarQubeQualityProfile validQualityProfile;
-
- private static readonly SonarQubeRule ActiveRuleWithUnsupportedSeverity = new SonarQubeRule("activeHotspot", "any1",
- true, SonarQubeIssueSeverity.Blocker, null, null, null, SonarQubeIssueType.SecurityHotspot);
-
- private static readonly SonarQubeRule InactiveRuleWithUnsupportedSeverity = new SonarQubeRule("inactiveHotspot", "any2",
- false, SonarQubeIssueSeverity.Blocker, null, null, null, SonarQubeIssueType.SecurityHotspot);
-
- private static readonly SonarQubeRule ActiveTaintAnalysisRule = new SonarQubeRule("activeTaint", "roslyn.sonaranalyzer.security.foo",
- true, SonarQubeIssueSeverity.Blocker, null, null, null, SonarQubeIssueType.CodeSmell);
-
- private static readonly SonarQubeRule InactiveTaintAnalysisRule = new SonarQubeRule("inactiveTaint", "roslyn.sonaranalyzer.security.bar",
- false, SonarQubeIssueSeverity.Blocker, null, null, null, SonarQubeIssueType.CodeSmell);
-
- [TestInitialize]
- public void TestInitialize()
- {
- validRules = new List { new SonarQubeRule("key", "repoKey", true, SonarQubeIssueSeverity.Blocker, null, null, null, SonarQubeIssueType.Bug) };
-
- anyProperties = Array.Empty();
-
- validQualityProfile = new SonarQubeQualityProfile("qpkey1", "qp name", "any", false, DateTime.UtcNow);
- }
-
- [TestMethod]
- public void MefCtor_CheckIsExported() =>
- MefTestHelpers.CheckTypeCanBeImported(
- MefTestHelpers.CreateExport(),
- MefTestHelpers.CreateExport(),
- MefTestHelpers.CreateExport(),
- MefTestHelpers.CreateExport());
-
- [TestMethod]
- public void MefCtor_CheckIsSingleton() =>
- MefTestHelpers.CheckIsSingletonMefComponent();
-
- [TestMethod]
- public void GetRules_UnsupportedLanguage_Throws()
- {
- var builder = new TestEnvironmentBuilder(validQualityProfile, Language.Cpp);
- var testSubject = builder.CreateTestSubject();
-
- // Act
- Action act = () => testSubject.SaveConfigurationAsync(validQualityProfile, Language.Cpp, BindingConfiguration.Standalone, CancellationToken.None).Wait();
-
- // Assert
- act.Should().ThrowExactly().And.ParamName.Should().Be("language");
- }
-
- [TestMethod]
- public void IsLanguageSupported()
- {
- // Arrange
- var builder = new TestEnvironmentBuilder(validQualityProfile, Language.Cpp);
- var testSubject = builder.CreateTestSubject();
-
- // 1. Supported languages
- testSubject.IsLanguageSupported(Language.CSharp).Should().BeTrue();
- testSubject.IsLanguageSupported(Language.VBNET).Should().BeTrue();
-
- // 2. Not supported
- testSubject.IsLanguageSupported(Language.C).Should().BeFalse();
- testSubject.IsLanguageSupported(Language.Cpp).Should().BeFalse();
-
- testSubject.IsLanguageSupported(Language.Unknown).Should().BeFalse();
- }
-
- [TestMethod]
- public async Task GetConfig_NoSupportedActiveRules_Throws()
- {
- // Arrange
- var builder = new TestEnvironmentBuilder(validQualityProfile, Language.VBNET)
- {
- ActiveRulesResponse = new List { ActiveRuleWithUnsupportedSeverity }, InactiveRulesResponse = validRules, PropertiesResponse = anyProperties
- };
- var testSubject = builder.CreateTestSubject();
-
- // Act
- var act = () => testSubject.SaveConfigurationAsync(validQualityProfile, Language.VBNET, builder.BindingConfiguration, CancellationToken.None);
-
- // Assert
- await act.Should().ThrowExactlyAsync().WithMessage(string.Format(QualityProfilesStrings.FailedToCreateBindingConfigForLanguage, Language.VBNET.Name));
-
- builder.Logger.AssertOutputStrings(1);
- var expectedOutput = string.Format(BindingStrings.SubTextPaddingFormat,
- string.Format(BindingStrings.NoSonarAnalyzerActiveRulesForQualityProfile, validQualityProfile.Name, Language.VBNET.Name));
- builder.Logger.AssertOutputStrings(expectedOutput);
- builder.RoslynConfigGenerator.DidNotReceiveWithAnyArgs().GenerateAndSaveConfiguration(Arg.Any(), Arg.Any(), Arg.Any>(), Arg.Any(), Arg.Any>(), Arg.Any>());
- }
-
- [TestMethod]
- public async Task GetConfig_HasActiveInactiveAndUnsupportedRules_ReturnsValidBindingConfig()
- {
- // Arrange
- const string expectedServerUrl = "http://myhost:123/";
-
- var properties = new SonarQubeProperty[] { new("propertyAAA", "111"), new("propertyBBB", "222") };
-
- var activeSupportedRule = CreateRule("activeRuleKey", "repoKey1", true);
- var activeRules = new[] { activeSupportedRule, ActiveTaintAnalysisRule, ActiveRuleWithUnsupportedSeverity };
- var inactiveSupportedRule = CreateRule("inactiveRuleKey", "repoKey2", false);
- var inactiveRules = new[] { inactiveSupportedRule, InactiveTaintAnalysisRule, InactiveRuleWithUnsupportedSeverity };
-
- var builder = new TestEnvironmentBuilder(validQualityProfile, Language.CSharp, expectedServerUrl)
- {
- ActiveRulesResponse = activeRules, InactiveRulesResponse = inactiveRules, PropertiesResponse = properties
- };
-
- var testSubject = builder.CreateTestSubject();
-
- // Act
- await testSubject.SaveConfigurationAsync(validQualityProfile, Language.CSharp, builder.BindingConfiguration, CancellationToken.None);
-
- // Assert
- builder.RoslynConfigGenerator
- .Received()
- .GenerateAndSaveConfiguration(
- Language.CSharp,
- builder.BindingConfiguration.BindingConfigDirectory,
- Arg.Is>(x => x.SequenceEqual(builder.SonarProperties)),
- builder.ServerExclusionsResponse,
- Arg.Is((IReadOnlyCollection x) =>
- x.Select(y => y.Key).SequenceEqual(new []{activeSupportedRule.Key, inactiveSupportedRule.Key})),
- Arg.Is>(x => x.SequenceEqual(new []{activeSupportedRule})));
- builder.Logger.AssertOutputStrings(0); // not expecting anything in the case of success
- }
-
- [TestMethod]
- [DataRow("roslyn.sonaranalyzer.security.cs", false)]
- [DataRow("roslyn.sonaranalyzer.security.vb", false)]
- [DataRow("ROSLYN.SONARANALYZER.SECURITY.X", false)]
- [DataRow("roslyn.wintellect", true)]
- [DataRow("sonaranalyzer-cs", true)]
- [DataRow("sonaranalyzer-vbnet", true)]
- public void IsSupportedRule_TaintRules(string repositoryKey, bool expected)
- {
- var rule = CreateRule("any", repositoryKey, true);
-
- RoslynBindingConfigProvider.IsSupportedRule(rule).Should().Be(expected);
- }
-
- [TestMethod]
- [DataRow(SonarQubeIssueType.Unknown, false)]
- [DataRow(SonarQubeIssueType.SecurityHotspot, false)]
- [DataRow(SonarQubeIssueType.CodeSmell, true)]
- [DataRow(SonarQubeIssueType.Bug, true)]
- [DataRow(SonarQubeIssueType.Vulnerability, true)]
- public void IsSupportedRule_Severity(SonarQubeIssueType issueType, bool expected)
- {
- var rule = new SonarQubeRule("any", "any", true, SonarQubeIssueSeverity.Blocker, null, null, null, issueType);
-
- RoslynBindingConfigProvider.IsSupportedRule(rule).Should().Be(expected);
- }
-
- private static SonarQubeRule CreateRule(string ruleKey, string repoKey, bool isActive) =>
- new SonarQubeRule(ruleKey, repoKey, isActive, SonarQubeIssueSeverity.Blocker, null, null, null, SonarQubeIssueType.CodeSmell);
-
- private class TestEnvironmentBuilder
- {
- private Mock sonarQubeServiceMock;
-
- private readonly SonarQubeQualityProfile profile;
- private readonly Language language;
- private readonly string serverUrl;
-
- private const string ExpectedProjectKey = "fixed.project.key";
-
- public TestEnvironmentBuilder(SonarQubeQualityProfile profile, Language language, string serverUrl = "http://any")
- {
- this.profile = profile;
- this.language = language;
- this.serverUrl = serverUrl;
-
- Logger = new TestLogger();
- PropertiesResponse = new List();
- }
-
- public BindingConfiguration BindingConfiguration { get; private set; }
- public IRoslynConfigGenerator RoslynConfigGenerator { get; private set; }
- public IList ActiveRulesResponse { get; set; }
- public IList InactiveRulesResponse { get; set; }
- public IList PropertiesResponse { get; set; }
-
- public ServerExclusions ServerExclusionsResponse { get; set; }
- public Dictionary SonarProperties { get; set; }
- public TestLogger Logger { get; private set; }
-
- public RoslynBindingConfigProvider CreateTestSubject()
- {
- // Note: where possible, the mocked methods are set up with the expected
- // parameter values i.e. they will only be called if the correct values
- // are passed in.
- Logger = new TestLogger();
-
- sonarQubeServiceMock = new Mock();
- sonarQubeServiceMock
- .Setup(x => x.GetRulesAsync(true, profile.Key, It.IsAny()))
- .ReturnsAsync(ActiveRulesResponse);
-
- sonarQubeServiceMock
- .Setup(x => x.GetRulesAsync(false, profile.Key, It.IsAny()))
- .ReturnsAsync(InactiveRulesResponse);
-
- sonarQubeServiceMock
- .Setup(x => x.GetAllPropertiesAsync(ExpectedProjectKey, It.IsAny()))
- .ReturnsAsync(PropertiesResponse);
-
- ServerExclusionsResponse = new ServerExclusions(
- exclusions: ["path1"],
- globalExclusions: ["path2"],
- inclusions: ["path3"]);
-
- sonarQubeServiceMock
- .Setup(x => x.GetServerExclusions(ExpectedProjectKey, It.IsAny()))
- .ReturnsAsync(ServerExclusionsResponse);
-
- BindingConfiguration = new BindingConfiguration(
- new BoundServerProject("solution", ExpectedProjectKey, new ServerConnection.SonarQube(new Uri(serverUrl))),
- SonarLintMode.Connected,
- "c:\\test\\");
-
- SonarProperties = PropertiesResponse.ToDictionary(x => x.Key, y => y.Value);
-
- RoslynConfigGenerator = Substitute.For();
-
- return new RoslynBindingConfigProvider(sonarQubeServiceMock.Object, Logger,
- RoslynConfigGenerator,
- LanguageProvider.Instance);
- }
- }
-}
diff --git a/src/ConnectedMode.UnitTests/Binding/SonarQubeRoslynRuleStatusTests.cs b/src/ConnectedMode.UnitTests/Binding/SonarQubeRoslynRuleStatusTests.cs
deleted file mode 100644
index 81fce6817c..0000000000
--- a/src/ConnectedMode.UnitTests/Binding/SonarQubeRoslynRuleStatusTests.cs
+++ /dev/null
@@ -1,195 +0,0 @@
-/*
- * SonarLint for Visual Studio
- * Copyright (C) 2016-2025 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-using SonarLint.VisualStudio.ConnectedMode.Binding;
-using SonarLint.VisualStudio.Core;
-using SonarLint.VisualStudio.Core.CSharpVB;
-using SonarQube.Client.Models;
-using ArgumentOutOfRangeException = System.ArgumentOutOfRangeException;
-
-namespace SonarLint.VisualStudio.ConnectedMode.UnitTests.Binding;
-
-[TestClass]
-public class SonarQubeRoslynRuleStatusTests
-{
- private IEnvironmentSettings environmentSettings;
-
- [TestInitialize]
- public void TestInitialize()
- {
- environmentSettings = Substitute.For();
- }
-
- [TestMethod]
- [DataRow(SonarQubeIssueSeverity.Info, RuleAction.Info)]
- [DataRow(SonarQubeIssueSeverity.Minor, RuleAction.Info)]
- [DataRow(SonarQubeIssueSeverity.Major, RuleAction.Warning)]
- [DataRow(SonarQubeIssueSeverity.Critical, RuleAction.Warning)]
- public void GetVSSeverity_NotBlocker_CorrectlyMapped(SonarQubeIssueSeverity sqSeverity, RuleAction expectedVsSeverity)
- {
- var testSubject = new SonarQubeRoslynRuleStatus(CreateStandardRule(sqSeverity), environmentSettings);
-
- testSubject.GetSeverity().Should().Be(expectedVsSeverity);
- }
-
- [TestMethod]
- [DataRow(true, RuleAction.Error)]
- [DataRow(false, RuleAction.Warning)]
- public void GetVSSeverity_Blocker_CorrectlyMapped(bool shouldTreatBlockerAsError, RuleAction expectedVsSeverity)
- {
- environmentSettings.TreatBlockerSeverityAsError().Returns(shouldTreatBlockerAsError);
-
- var testSubject = new SonarQubeRoslynRuleStatus(CreateStandardRule(SonarQubeIssueSeverity.Blocker), environmentSettings);
-
- testSubject.GetSeverity().Should().Be(expectedVsSeverity);
- }
-
- [TestMethod]
- [DataRow(SonarQubeIssueSeverity.Unknown)]
- [DataRow((SonarQubeIssueSeverity)(-1))]
- public void GetVSSeverity_Invalid_Throws(SonarQubeIssueSeverity sqSeverity)
- {
- var testSubject = new SonarQubeRoslynRuleStatus(CreateStandardRule(sqSeverity), environmentSettings);
-
- Action act = () => testSubject.GetSeverity();
-
- act.Should().Throw();
- }
-
- [DataTestMethod]
- [DataRow(SonarQubeSoftwareQualitySeverity.Info, RuleAction.Info)]
- [DataRow(SonarQubeSoftwareQualitySeverity.Low, RuleAction.Info)]
- [DataRow(SonarQubeSoftwareQualitySeverity.Medium, RuleAction.Warning)]
- public void GetVSSeverity_FromSoftwareQualitySeverity_NotBlocker_CorrectlyMapped(SonarQubeSoftwareQualitySeverity sqSeverity, RuleAction expectedVsSeverity)
- {
- var testSubject = new SonarQubeRoslynRuleStatus(
- CreateMqrRule(sqSeverity),
- environmentSettings);
-
- testSubject.GetSeverity().Should().Be(expectedVsSeverity);
- }
-
- [TestMethod]
- [DataRow(SonarQubeSoftwareQualitySeverity.High, true, RuleAction.Error)]
- [DataRow(SonarQubeSoftwareQualitySeverity.High, false, RuleAction.Warning)]
- [DataRow(SonarQubeSoftwareQualitySeverity.Blocker, true, RuleAction.Error)]
- [DataRow(SonarQubeSoftwareQualitySeverity.Blocker, false, RuleAction.Warning)]
- public void GetVSSeverity_FromSoftwareQualitySeverity_Blocker_CorrectlyMapped(SonarQubeSoftwareQualitySeverity sqSeverity, bool shouldTreatBlockerAsError, RuleAction expectedVsSeverity)
- {
- environmentSettings.TreatBlockerSeverityAsError().Returns(shouldTreatBlockerAsError);
-
- var testSubject = new SonarQubeRoslynRuleStatus(CreateMqrRule(sqSeverity), environmentSettings);
-
- testSubject.GetSeverity().Should().Be(expectedVsSeverity);
- }
-
- [TestMethod]
- public void GetVSSeverity_FromSoftwareQualitySeverity_Invalid_Throws()
- {
- var testSubject = new SonarQubeRoslynRuleStatus(CreateMqrRule((SonarQubeSoftwareQualitySeverity)(-1)), environmentSettings);
-
- Action act = () => testSubject.GetSeverity();
-
- act.Should().Throw();
- }
-
- [DynamicData(nameof(MultipleMqrSeveritiesAndHighestConvertedVsSeverity))]
- [DataTestMethod]
- public void GetVSSeverity_FromSoftwareQualitySeverity_Multiple_TakesHighest(SonarQubeSoftwareQualitySeverity[] severities, RuleAction expectedAction)
- {
- var testSubject = new SonarQubeRoslynRuleStatus(CreateMqrRule(severities), environmentSettings);
-
- testSubject.GetSeverity().Should().Be(expectedAction);
- }
-
- [DataRow(SonarQubeIssueSeverity.Info, RuleAction.Info)]
- [DataRow(SonarQubeIssueSeverity.Minor, RuleAction.Info)]
- [DataRow(SonarQubeIssueSeverity.Major, RuleAction.Warning)]
- [DataRow(SonarQubeIssueSeverity.Critical, RuleAction.Warning)]
- [DataTestMethod]
- public void GetVSSeverity_EmptyMqrSeverities_UsesStandardSeverity(SonarQubeIssueSeverity sqSeverity, RuleAction expectedVsSeverity)
- {
- var testSubject = new SonarQubeRoslynRuleStatus(CreateRule(new(), sqSeverity), environmentSettings);
-
- testSubject.GetSeverity().Should().Be(expectedVsSeverity);
- }
-
- [DynamicData(nameof(AllMqrSeverities))]
- [DataTestMethod]
- public void GetVSSeverity_HasSoftwareQualitySeverity_Inactive_ReturnsNone(SonarQubeSoftwareQualitySeverity severities)
- {
- var testSubject = new SonarQubeRoslynRuleStatus(CreateMqrRule(isActive: false, severities), environmentSettings);
-
- testSubject.GetSeverity().Should().Be(RuleAction.None);
- }
-
- [DynamicData(nameof(AllSeverities))]
- [DataTestMethod]
- public void GetVSSeverity_HasSeverity_Inactive_ReturnsNone(SonarQubeIssueSeverity severity)
- {
- var testSubject = new SonarQubeRoslynRuleStatus(CreateStandardRule(severity, isActive: false), environmentSettings);
-
- testSubject.GetSeverity().Should().Be(RuleAction.None);
- }
-
- public static object[][] MultipleMqrSeveritiesAndHighestConvertedVsSeverity =>
- [
- [new[] { SonarQubeSoftwareQualitySeverity.Blocker, SonarQubeSoftwareQualitySeverity.Low }, RuleAction.Warning],
- [new[] { SonarQubeSoftwareQualitySeverity.Low, SonarQubeSoftwareQualitySeverity.Blocker }, RuleAction.Warning],
- [new[] { SonarQubeSoftwareQualitySeverity.Blocker, SonarQubeSoftwareQualitySeverity.Blocker }, RuleAction.Warning],
- [new[] { SonarQubeSoftwareQualitySeverity.Low, SonarQubeSoftwareQualitySeverity.Info }, RuleAction.Info],
- [new[] { SonarQubeSoftwareQualitySeverity.Low, SonarQubeSoftwareQualitySeverity.Info, SonarQubeSoftwareQualitySeverity.High }, RuleAction.Warning],
- ];
-
- public static object[][] AllMqrSeverities =>
- Enum.GetValues(typeof(SonarQubeSoftwareQualitySeverity)).Cast