public void SetUp()
        {
            _remoteReferenceRepository ??= new ReferenceRepository();

            // we will be modifying .git/config and need to completely reset each time
            _referenceRepository = new ReferenceRepository();

            _referenceRepository.Module.AddRemote(RemoteName, _remoteReferenceRepository.Module.WorkingDir);
            _referenceRepository.Fetch(RemoteName);

            _commands = new GitUICommands(_referenceRepository.Module);

            _referenceRepository.CreateCommit("Commit1", "Commit1");
            _referenceRepository.CreateBranch("Branch1", _referenceRepository.CommitHash);
            _referenceRepository.CreateTag("Branch1", _referenceRepository.CommitHash);
            _referenceRepository.CreateCommit("Commit2", "Commit2");
            _referenceRepository.CreateBranch("Branch2", _referenceRepository.CommitHash);

            _referenceRepository.CreateCommit("head commit");

            var composition = TestComposition.Empty
                              .AddParts(typeof(MockWindowsJumpListManager))
                              .AddParts(typeof(MockRepositoryDescriptionProvider))
                              .AddParts(typeof(MockAppTitleGenerator));
            ExportProvider mefExportProvider = composition.ExportProviderFactory.CreateExportProvider();

            ManagedExtensibility.SetTestExportProvider(mefExportProvider);
        }
        public void SetUp()
        {
            _repo1 = new GitModuleTestHelper("repo1");
            _repo2 = new GitModuleTestHelper("repo2");
            _repo3 = new GitModuleTestHelper("repo3");

            _repo2.AddSubmodule(_repo3, "repo3");
            _repo1.AddSubmodule(_repo2, "repo2");
            var submodules = _repo1.GetSubmodulesRecursive();

            _repo1Module = _repo1.Module;
            _repo2Module = submodules.ElementAt(0);
            _repo3Module = submodules.ElementAt(1);

            // Use the singleton provider, which is also used by the left panel, so we can synchronize on updates
            _provider = SubmoduleStatusProvider.Default;

            _commands = new GitUICommands(_repo1Module);

            var composition = TestComposition.Empty
                              .AddParts(typeof(MockWindowsJumpListManager))
                              .AddParts(typeof(MockRepositoryDescriptionProvider))
                              .AddParts(typeof(MockAppTitleGenerator));
            ExportProvider mefExportProvider = composition.ExportProviderFactory.CreateExportProvider();

            ManagedExtensibility.SetTestExportProvider(mefExportProvider);
        }
Beispiel #3
0
        public void SetUp()
        {
            if (_referenceRepository is null)
            {
                _referenceRepository = new ReferenceRepository();
            }
            else
            {
                _referenceRepository.Reset();
            }

            ExportProvider mefExportProvider = TestComposition.Empty.ExportProviderFactory.CreateExportProvider();

            ManagedExtensibility.SetTestExportProvider(mefExportProvider);
        }
        public void SetUp()
        {
            if (_referenceRepository is null)
            {
                _referenceRepository = new ReferenceRepository();
            }
            else
            {
                _referenceRepository.Reset();
            }

            _commands = new GitUICommands(_referenceRepository.Module);

            ExportProvider mefExportProvider = _composition.ExportProviderFactory.CreateExportProvider();

            ManagedExtensibility.SetTestExportProvider(mefExportProvider);
        }
Beispiel #5
0
        public void SetUp()
        {
            if (_referenceRepository is null)
            {
                _referenceRepository = new ReferenceRepository();
            }
            else
            {
                _referenceRepository.Reset();
            }

            var composition = TestComposition.Empty
                              .AddParts(typeof(MockGenericBuildServerAdapter))
                              .AddParts(typeof(MockGenericBuildServerSettingsUserControl));
            ExportProvider mefExportProvider = composition.ExportProviderFactory.CreateExportProvider();

            ManagedExtensibility.SetTestExportProvider(mefExportProvider);
        }
Beispiel #6
0
        public void SetUp()
        {
            if (_referenceRepository is null)
            {
                _referenceRepository = new ReferenceRepository();
            }
            else
            {
                _referenceRepository.Reset();
            }

            _commands = new GitUICommands(_referenceRepository.Module);

            var composition = TestComposition.Empty
                              .AddParts(typeof(MockWindowsJumpListManager))
                              .AddParts(typeof(MockRepositoryDescriptionProvider))
                              .AddParts(typeof(MockAppTitleGenerator));
            ExportProvider mefExportProvider = composition.ExportProviderFactory.CreateExportProvider();

            ManagedExtensibility.SetTestExportProvider(mefExportProvider);
        }
Beispiel #7
0
        public void SetUp()
        {
            // we will be modifying .git/config and need to completely reset each time
            _referenceRepository = new ReferenceRepository();

            foreach (var name in RemoteNames)
            {
                _referenceRepository.Module.AddRemote(name, $"http://localhost/remotes/{name}.git");
            }

            _commands       = new GitUICommands(_referenceRepository.Module);
            _remotesManager = new ConfigFileRemoteSettingsManager(() => _referenceRepository.Module);

            var composition = TestComposition.Empty
                              .AddParts(typeof(MockWindowsJumpListManager))
                              .AddParts(typeof(MockRepositoryDescriptionProvider))
                              .AddParts(typeof(MockAppTitleGenerator));
            ExportProvider mefExportProvider = composition.ExportProviderFactory.CreateExportProvider();

            ManagedExtensibility.SetTestExportProvider(mefExportProvider);
        }
Beispiel #8
0
        public void ParseScriptArguments_resolve_RepoName()
        {
            var composition = TestComposition.Empty
                              .AddParts(typeof(MockRepositoryDescriptionProvider));

            ExportProvider mefExportProvider = composition.ExportProviderFactory.CreateExportProvider();

            ManagedExtensibility.SetTestExportProvider(mefExportProvider);

            var option  = "RepoName";
            var dirName = MockRepositoryDescriptionProvider.ShortName; // chose one which will never contain a repo

            _module.WorkingDir.Returns("C:\\" + dirName);

            var result = ScriptOptionsParser.GetTestAccessor().ParseScriptArguments(
                arguments: "{" + option + "}", option,
                owner: null, scriptHostControl: null, _module, allSelectedRevisions: null, selectedTags: null,
                selectedBranches: null, selectedLocalBranches: null, selectedRemoteBranches: null, selectedRemotes: null, selectedRevision: null,
                currentTags: null,
                currentBranches: null, currentLocalBranches: null, currentRemoteBranches: null, currentRevision: null, currentRemote: null);

            result.Should().Be(dirName);
        }
Beispiel #9
0
        public void SetUp()
        {
            _repo1 = new GitModuleTestHelper("repo1");
            _repo2 = new GitModuleTestHelper("repo2");
            _repo3 = new GitModuleTestHelper("repo3");

            _repo2.AddSubmodule(_repo3, "repo3");
            _repo1.AddSubmodule(_repo2, "repo2");
            var submodules = _repo1.GetSubmodulesRecursive();

            _repo1Module = _repo1.Module;
            _repo2Module = submodules.ElementAt(0);
            _repo3Module = submodules.ElementAt(1);

            // Use the singleton provider, which is also used by the left panel, so we can synchronize on updates
            _provider = SubmoduleStatusProvider.Default;

            _commands = new GitUICommands(_repo1Module);

            ExportProvider mefExportProvider = _composition.ExportProviderFactory.CreateExportProvider();

            ManagedExtensibility.SetTestExportProvider(mefExportProvider);
        }
Beispiel #10
0
        public void SetUp()
        {
            _remoteReferenceRepository ??= new ReferenceRepository();

            // we will be modifying .git/config and need to completely reset each time
            _referenceRepository = new ReferenceRepository();

            _referenceRepository.Module.AddRemote(RemoteName, _remoteReferenceRepository.Module.WorkingDir);
            _referenceRepository.Fetch(RemoteName);

            _commands = new GitUICommands(_referenceRepository.Module);

            _referenceRepository.CreateCommit("Commit1", "Commit1");
            _referenceRepository.CreateBranch("Branch1", _referenceRepository.CommitHash);
            _referenceRepository.CreateTag("Branch1", _referenceRepository.CommitHash);
            _referenceRepository.CreateCommit("Commit2", "Commit2");
            _referenceRepository.CreateBranch("Branch2", _referenceRepository.CommitHash);

            _referenceRepository.CreateCommit("head commit");

            ExportProvider mefExportProvider = _composition.ExportProviderFactory.CreateExportProvider();

            ManagedExtensibility.SetTestExportProvider(mefExportProvider);
        }