Example #1
0
        public void Single_NoCredentials()
        {
            var source = new NuGetSource
            {
                Source = "http://foo"
            };
            var p = new TeamCitySingleCredentialProvider(source);

            AssertAuth(p);
        }
Example #2
0
        private void nuGetSourcesListBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            _currentSource = null;

            if (nuGetSourcesListBox.SelectedItem != null)
            {
                _currentSource = nuGetSourcesListBox.SelectedItem as NuGetSource;
            }

            UpdateByState();
        }
Example #3
0
        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");
        }
Example #4
0
        public void Single_Credentials()
        {
            var source = new NuGetSource
            {
                Source   = "http://foo",
                Username = "******",
                Password = "******"
            };
            var p = new TeamCitySingleCredentialProvider(source);

            AssertAuth(p, username: "******", password: "******");
        }
Example #5
0
 private void removeButton_Click(object sender, EventArgs e)
 {
     try
     {
         _sources.Remove(_currentSource);
         _currentSource = null;
         UpdateItems();
         UpdateByState();
     }
     catch (Exception exception)
     {
         exception.ShowError();
     }
 }
Example #6
0
        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();
            }
        }