public void Single_NoCredentials() { var source = new NuGetSource { Source = "http://foo" }; var p = new TeamCitySingleCredentialProvider(source); AssertAuth(p); }
private void nuGetSourcesListBox_SelectedIndexChanged(object sender, EventArgs e) { _currentSource = null; if (nuGetSourcesListBox.SelectedItem != null) { _currentSource = nuGetSourcesListBox.SelectedItem as NuGetSource; } UpdateByState(); }
public void Multiple_Credentials_One() { var source = new NuGetSource { Source = "http://foo", Username = "******", Password = "******" }; var p = new TeamCityMultipleCredentialProvider(new INuGetSource[] { source }); AssertAuth(p, username: "******", password: "******", url: "http://foo"); }
public void Single_Credentials() { var source = new NuGetSource { Source = "http://foo", Username = "******", Password = "******" }; var p = new TeamCitySingleCredentialProvider(source); AssertAuth(p, username: "******", password: "******"); }
private void removeButton_Click(object sender, EventArgs e) { try { _sources.Remove(_currentSource); _currentSource = null; UpdateItems(); UpdateByState(); } catch (Exception exception) { exception.ShowError(); } }
private void saveButton_Click(object sender, EventArgs e) { switch (_state) { case SettingsFormStates.Add: try { NuGetSource nuGetSource = new NuGetSource(nameTextBox.Text, urlTextBox.Text, keyTextBox.Text); _sources.Add(nuGetSource); _state = SettingsFormStates.View; UpdateItems(); UpdateByState(); } catch (Exception exception) { exception.ShowError(); } break; case SettingsFormStates.Edit: try { _sources.Edit(_currentSource, nameTextBox.Text, urlTextBox.Text, keyTextBox.Text); _state = SettingsFormStates.View; UpdateItems(); UpdateByState(); } catch (Exception exception) { exception.ShowError(); } break; default: throw new ArgumentOutOfRangeException(); } }