Beispiel #1
0
        public async Task AzureReposHostProvider_ConfigureAsync_UseHttpPathUnset_SetsUseHttpPathTrue()
        {
            var context  = new TestCommandContext();
            var provider = new AzureReposHostProvider(context);

            await provider.ConfigureAsync(ConfigurationTarget.User);

            Assert.Single(context.Git.Configuration.Global);
            Assert.True(context.Git.Configuration.Global.TryGetValue(AzDevUseHttpPathKey, out IList <string> actualValues));
            Assert.Single(actualValues);
            Assert.Equal("true", actualValues[0]);
        }
        public async Task AzureReposHostProvider_ConfigureAsync_UseHttpPathSetTrue_DoesNothing()
        {
            var context  = new TestCommandContext();
            var provider = new AzureReposHostProvider(context);

            context.Git.GlobalConfiguration.Dictionary[AzDevUseHttpPathKey] = new List <string> {
                "true"
            };

            await provider.ConfigureAsync(ConfigurationTarget.User);

            Assert.Single(context.Git.GlobalConfiguration.Dictionary);
            Assert.True(context.Git.GlobalConfiguration.Dictionary.TryGetValue(AzDevUseHttpPathKey, out IList <string> actualValues));
            Assert.Single(actualValues);
            Assert.Equal("true", actualValues[0]);
        }
Beispiel #3
0
        public async Task AzureReposHostProvider_ConfigureAsync_UseHttpPathUnset_SetsUseHttpPathTrue()
        {
            var provider = new AzureReposHostProvider(new TestCommandContext());

            var environment = new TestEnvironment();
            var git         = new TestGit();

            await provider.ConfigureAsync(
                environment, EnvironmentVariableTarget.User,
                git, GitConfigurationLevel.Global);

            Assert.Single(git.GlobalConfiguration.Dictionary);
            Assert.True(git.GlobalConfiguration.Dictionary.TryGetValue(AzDevUseHttpPathKey, out IList <string> actualValues));
            Assert.Single(actualValues);
            Assert.Equal("true", actualValues[0]);
        }
        public async Task AzureReposHostProvider_ConfigureAsync_UseHttpPathSetFalse_SetsUseHttpPathTrue()
        {
            var provider = new AzureReposHostProvider(new TestCommandContext());

            var environment = new TestEnvironment();
            var config      = new TestGitConfiguration(new Dictionary <string, IList <string> >
            {
                [AzDevUseHttpPathKey] = new List <string> {
                    "false"
                }
            });

            await provider.ConfigureAsync(
                environment, EnvironmentVariableTarget.User,
                config, GitConfigurationLevel.Global);

            Assert.Single(config.Dictionary);
            Assert.True(config.Dictionary.TryGetValue(AzDevUseHttpPathKey, out IList <string> actualValues));
            Assert.Single(actualValues);
            Assert.Equal("true", actualValues[0]);
        }