Exemple #1
0
        internal void AddMappedRepo(RepoMapping mapping)
        {
            List <string> mappedRepos =
                mSection.GetStringList(MAPS_KEY, new string[] { });

            mappedRepos.Add(mapping.ToConfigurationString());
            mSection.SetStringList(MAPS_KEY, mappedRepos);
        }
Exemple #2
0
        internal void DeleteMappedRepo(RepoMapping mapping)
        {
            string mapToRemove = mapping.ToConfigurationString();

            List <string> mappedRepos =
                mSection.GetStringList(MAPS_KEY, new string[] { });

            mappedRepos.RemoveAll(item =>
                                  item.Equals(mapToRemove, StringComparison.InvariantCultureIgnoreCase));
            mSection.SetStringList(MAPS_KEY, mappedRepos);
        }
        public void ParseRepoMappingTest()
        {
            string srcRepo   = "default";
            string dstRepo   = "default_dst";
            string dstServer = "skull.home:8087";

            RepoMapping repoMapping =
                new RepoMapping(srcRepo, dstRepo, dstServer);

            List <string> configuration =
                new List <string>()
            {
                repoMapping.ToConfigurationString()
            };

            List <RepoMapping> parsedRepoMappings =
                RepoMapping.ParseConfiguration(configuration);

            Assert.AreEqual(1, parsedRepoMappings.Count);

            AssertRepoMappingEqual(repoMapping, parsedRepoMappings[0]);
        }