private bool IsBuildResultPageEnabled() { IBuildServerSettings buildServerSettings = GetModule() .GetEffectiveSettings() .BuildServer(); return(buildServerSettings.ShowBuildResultPage); }
public void RepoLocalAndEffective_settings_should_return_expected(bool isLocal) { IBuildServerSettings buildServerSettings = (isLocal ? _repoLocal : _effective).GetBuildServerSettings(); buildServerSettings.ServerName.Should().Be("AppVeyor"); buildServerSettings.IntegrationEnabled.Should().BeTrue(); // No explicit settings, inheriting from the repo distributed buildServerSettings.ShowBuildResultPage.Should().BeFalse(); ISettingsSource settingsSource = buildServerSettings.SettingsSource; settingsSource.Should().BeOfType <SettingsPath>(); ((SettingsPath)settingsSource).PathFor("").Should().Be("BuildServer.AppVeyor."); }
public void UserRoaming_settings_should_return_expected() { IBuildServerSettings buildServerSettings = _userRoaming.GetBuildServerSettings(); // Explicitly set buildServerSettings.ServerName.Should().Be("Azure DevOps and Team Foundation Server (since TFS2015)"); buildServerSettings.IntegrationEnabled.Should().BeTrue(); buildServerSettings.ShowBuildResultPage.Should().BeNull(); // Explicitly set ISettingsSource settingsSource = buildServerSettings.SettingsSource; settingsSource.Should().BeOfType <SettingsPath>(); ((SettingsPath)settingsSource).PathFor("").Should().Be("BuildServer.Azure DevOps and Team Foundation Server (since TFS2015)."); }
public void RepoDistributed_settings_should_return_expected() { IBuildServerSettings buildServerSettings = _repoLocal.GetBuildServerSettings(); // No explicit settings, inheriting from the repo local buildServerSettings.ServerName.Should().Be("AppVeyor"); buildServerSettings.IntegrationEnabled.Should().BeTrue(); // Explicitly set buildServerSettings.ShowBuildResultPage.Should().BeFalse(); // No explicit settings, inheriting from the repo local ISettingsSource settingsSource = buildServerSettings.SettingsSource; settingsSource.Should().BeOfType <SettingsPath>(); ((SettingsPath)settingsSource).PathFor("").Should().Be("BuildServer.AppVeyor."); }
protected override void PageToSettings() { IBuildServerSettings buildServerSettings = GetCurrentSettings() .BuildServer(); buildServerSettings.EnableIntegration = checkBoxEnableBuildServerIntegration.Checked; buildServerSettings.ShowBuildResultPage = checkBoxShowBuildResultPage.Checked; var selectedBuildServerType = GetSelectedBuildServerType(); buildServerSettings.Type = selectedBuildServerType; var control = buildServerSettingsPanel.Controls.OfType <IBuildServerSettingsUserControl>() .SingleOrDefault(); control?.SaveSettings(GetCurrentSettings().ByPath(buildServerSettings.Type !)); }
protected override void SettingsToPage() { ThreadHelper.JoinableTaskFactory.RunAsync( async() => { Validates.NotNull(_populateBuildServerTypeTask); await _populateBuildServerTypeTask.JoinAsync(); await this.SwitchToMainThreadAsync(); IBuildServerSettings buildServerSettings = GetCurrentSettings() .BuildServer(); checkBoxEnableBuildServerIntegration.SetNullableChecked(buildServerSettings.EnableIntegration); checkBoxShowBuildResultPage.SetNullableChecked(buildServerSettings.ShowBuildResultPage); BuildServerType.SelectedItem = buildServerSettings.Type ?? _noneItem.Text; }); }
private void ActivateBuildServerSettingsControl() { var controls = buildServerSettingsPanel.Controls.OfType <IBuildServerSettingsUserControl>().Cast <Control>(); var previousControl = controls.SingleOrDefault(); previousControl?.Dispose(); var control = CreateBuildServerSettingsUserControl(); buildServerSettingsPanel.Controls.Clear(); if (control is not null) { IBuildServerSettings buildServerSettings = GetCurrentSettings() .BuildServer(); control.LoadSettings(GetCurrentSettings().ByPath(buildServerSettings.Type !)); buildServerSettingsPanel.Controls.Add((Control)control); ((Control)control).Dock = DockStyle.Fill; } }