public void IsSonarQubePluginSupported_WhenUnsupportedVersionOfVSAndCSharpPluginEquals60_ReturnsTrue() { // Arrange VisualStudioHelpers.VisualStudioVersion = "14.0"; var testSubject = new ConnectionWorkflow(this.host, new RelayCommand(AssertIfCalled)); var sonarqubePlugin = new SonarQubePlugin("csharp", "6.0"); // Act var result = testSubject.IsSonarQubePluginSupported(new[] { sonarqubePlugin }, MinimumSupportedSonarQubePlugin.CSharp); // Assert result.Should().BeTrue(); this.outputWindowPane.AssertOutputStrings(" Discovered a supported plugin: Language: 'C#', Minimum version: '5.0', Maximum version: '7.0'"); }
public void IsSonarQubePluginSupported_WhenSupportedVersionOfVSAndVBNetPluginEquals50_ReturnsTrueAndWriteExpectedText() { // Arrange VisualStudioHelpers.VisualStudioVersion = "14.0.25420.00"; var testSubject = new ConnectionWorkflow(this.host, new RelayCommand(AssertIfCalled)); var sonarqubePlugin = new SonarQubePlugin("vbnet", "5.0"); // Act var result = testSubject.IsSonarQubePluginSupported(new[] { sonarqubePlugin }, MinimumSupportedSonarQubePlugin.VbNet); // Assert result.Should().BeTrue(); this.outputWindowPane.AssertOutputStrings(" Discovered a supported plugin: Language: 'VB.NET', Minimum version: '3.0'"); }
private static void TestPluginSupport(bool expectedResult, string vsVersion, SonarQubePlugin installedPlugin, MinimumSupportedSonarQubePlugin minimumSupportedPlugin, string expectedMessage) { // Arrange VisualStudioHelpers.VisualStudioVersion = vsVersion; var logger = new TestLogger(); // Act var result = ConnectionWorkflow.IsSonarQubePluginSupported(new[] { installedPlugin }, minimumSupportedPlugin, logger); // Assert result.Should().Be(expectedResult); logger.AssertOutputStrings(expectedMessage); }