public void RepoNameExtractorTest_ValidCurrentRemote(string remote, string url, string expProject, string expRepo)
        {
            _module.GetCurrentRemote().Returns(x => remote);
            _module.GetRemoteNames().Returns(x => new[] { remote, "    ", "\t" });
            _module.GetSetting(string.Format(SettingKeyString.RemoteUrl, remote)).Returns(x => url);

            var(project, repo) = _repoNameExtractor.Get();

            project.Should().Be(expProject);
            repo.Should().Be(expRepo);
        }
예제 #2
0
        public string ReplaceVariables(string projectNames)
        {
            var(repoProject, repoName) = _repoNameExtractor.Get();

            if (repoProject.IsNotNullOrWhitespace())
            {
                projectNames = projectNames.Replace("{cRepoProject}", repoProject);
            }

            if (repoName.IsNotNullOrWhitespace())
            {
                projectNames = projectNames.Replace("{cRepoShortName}", repoName);
            }

            return(projectNames);
        }