コード例 #1
0
        public void DownloadUrlInEnvironmentVar_InvalidUrl_UseDefault()
        {
            // Arrange
            SetUrlEnvironmentVariable("invalid uri");

            // Act
            var installer = new VSIX.DaemonInstaller(logger, "any", "any", envSettingsMock.Object);

            // Assert
            installer.DownloadUrl.Should().Be(VSIX.DaemonInstaller.DefaultDownloadUrl);
            installer.DaemonVersion.Should().Be(VSIX.DaemonInstaller.DefaultDaemonVersion);
        }
コード例 #2
0
        public void DownloadUrlInEnvironmentVar_InvalidVersion_UseDefault()
        {
            // Arrange
            SetUrlEnvironmentVariable("http://somewhere/sonarlint-daemon.zip");

            // Act
            var installer = new VSIX.DaemonInstaller(logger, "any", "any", envSettingsMock.Object);

            // Assert
            installer.DownloadUrl.Should().Be(VSIX.DaemonInstaller.DefaultDownloadUrl);
            installer.DaemonVersion.Should().Be(VSIX.DaemonInstaller.DefaultDaemonVersion);
        }
コード例 #3
0
        public void DownloadUrlInEnvironmentVar_InvalidVersion_UseDefault()
        {
            using (var scope = new EnvironmentVariableScope())
            {
                // Arrange
                scope.SetVariable(VSIX.DaemonInstaller.SonarLintDownloadUrlEnvVar, "http://somewhere/sonarlint-daemon.zip");

                // Act
                var installer = new VSIX.DaemonInstaller(logger);

                // Assert
                installer.DownloadUrl.Should().Be(VSIX.DaemonInstaller.DefaultDownloadUrl);
                installer.DaemonVersion.Should().Be(VSIX.DaemonInstaller.DefaultDaemonVersion);
            }
        }