Esempio n. 1
0
        public void Remove_should_save_definition_to_lowest_settings()
        {
            _parser = new GitExtLinksParser(_repoLocal);
            var definition = new GitExtLinkDef
            {
                Name          = "test",
                SearchPattern = "pattern"
            };

            _parser.AddLinkDef(definition);

            _parser.SaveToSettings();
            _repoLocal.SettingsCache.Save();
            _repoDistributed.SettingsCache.Save();
            _userRoaming.SettingsCache.Save();

            var settings = new RepoDistSettings(null, new GitExtSettingsCache(_level3));
            var parser   = new GitExtLinksParser(settings);

            parser.EffectiveLinkDefs.Count.Should().Be(2);
            var item = parser.EffectiveLinkDefs.Last();

            item.Name.Should().Be(definition.Name);
            item.SearchPattern.Should().Be(definition.SearchPattern);
        }
Esempio n. 2
0
        private void Add_Click(object sender, EventArgs e)
        {
            GitExtLinkDef newCategory = new GitExtLinkDef();

            newCategory.Name = "<new>";
            newCategory.SearchInParts.Add(GitExtLinkDef.RevisionPart.Message);
            newCategory.Enabled = true;
            parser.AddLinkDef(newCategory);
            ReloadCategories();
            _NO_TRANSLATE_Categories.SelectedItem = newCategory;
            CategoryChanged();
        }
Esempio n. 3
0
        private void Add_Click(object sender, EventArgs e)
        {
            GitExtLinkDef newCategory = new GitExtLinkDef();

            newCategory.Name = "<new>";
            newCategory.SearchInParts.Add(GitExtLinkDef.RevisionPart.Message);
            newCategory.RemoteSearchInParts.Add(GitExtLinkDef.RemotePart.URL);
            newCategory.Enabled            = true;
            newCategory.UseRemotesPattern  = "upstream|origin";
            newCategory.UseOnlyFirstRemote = true;
            parser.AddLinkDef(newCategory);
            ReloadCategories();
            _NO_TRANSLATE_Categories.SelectedItem = newCategory;
            CategoryChanged();
        }
Esempio n. 4
0
        public void Remove_should_add_definition_to_collection()
        {
            _parser = new GitExtLinksParser(_repoLocal);
            var definition = new GitExtLinkDef
            {
                Name          = "test",
                SearchPattern = "pattern"
            };

            _parser.AddLinkDef(definition);

            var effectiveSettings = _parser.EffectiveLinkDefs;

            // 1 comes from the user roaming settings
            // 3 come from the distributed
            // 2 comes from the local
            effectiveSettings.Count.Should().Be(6);
        }