Ejemplo n.º 1
0
 protected override void PageToSettings()
 {
     if (parser != null)
     {
         parser.SaveToSettings();
     }
 }
Ejemplo n.º 2
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);
        }