コード例 #1
0
        public void TestCombineGitUrl()
        {
            var repoInfo = GitUtility.Parse("[email protected]:dotnet/docfx");
            var url      = GitUtility.CombineUrl(repoInfo.NormalizedRepoUrl.AbsoluteUri, "dev", "src/docfx/Program.cs", RepoType.GitHub);

            Assert.Equal("https://github.com/dotnet/docfx/blob/dev/src/docfx/Program.cs", url.AbsoluteUri);

            repoInfo = GitUtility.Parse("https://mseng.visualstudio.com/FakeProject/_git/DocAsCode");
            url      = GitUtility.CombineUrl(repoInfo.NormalizedRepoUrl.AbsoluteUri, "dev", "src/docfx/Program.cs", RepoType.Vso);
            Assert.Equal("https://mseng.visualstudio.com/DefaultCollection/FakeProject/_git/DocAsCode?path=%2fsrc%2fdocfx%2fProgram.cs&version=GBdev&_a=contents", url.AbsoluteUri);
        }