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

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

            await provider.UnconfigureAsync(ConfigurationTarget.System);

            Assert.Empty(context.Git.Configuration.System);
        }
Beispiel #2
0
        public async Task AzureReposHostProvider_UnconfigureAsync_UseHttpPathSet_RemovesEntry()
        {
            var context  = new TestCommandContext();
            var provider = new AzureReposHostProvider(context);

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

            await provider.UnconfigureAsync(ConfigurationTarget.User);

            Assert.Empty(context.Git.Configuration.Global);
        }
Beispiel #3
0
        public async Task AzureReposHostProvider_UnconfigureAsync_User_Windows_UseHttpPathSetAndManagerCoreHelper_RemovesEntry()
        {
            var context  = new TestCommandContext();
            var provider = new AzureReposHostProvider(context);

            context.Git.Configuration.Global[HelperKey] = new List <string> {
                "manager-core"
            };
            context.Git.Configuration.Global[AzDevUseHttpPathKey] = new List <string> {
                "true"
            };

            await provider.UnconfigureAsync(ConfigurationTarget.User);

            Assert.False(context.Git.Configuration.Global.TryGetValue(AzDevUseHttpPathKey, out _));
        }
Beispiel #4
0
        public async Task AzureReposHostProvider_UnconfigureAsync_UseHttpPathSet_RemovesEntry()
        {
            var provider = new AzureReposHostProvider(new TestCommandContext());

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

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

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

            Assert.Empty(git.GlobalConfiguration.Dictionary);
        }
Beispiel #5
0
        public async Task AzureReposHostProvider_UnconfigureAsync_System_Windows_UseHttpPathSetAndManagerCoreHelper_DoesNotRemoveEntry()
        {
            var context  = new TestCommandContext();
            var provider = new AzureReposHostProvider(context);

            context.Git.Configuration.System[HelperKey] = new List <string> {
                "manager-core"
            };
            context.Git.Configuration.System[AzDevUseHttpPathKey] = new List <string> {
                "true"
            };

            await provider.UnconfigureAsync(ConfigurationTarget.System);

            Assert.True(context.Git.Configuration.System.TryGetValue(AzDevUseHttpPathKey, out IList <string> actualValues));
            Assert.Single(actualValues);
            Assert.Equal("true", actualValues[0]);
        }