Esempio n. 1
0
        public void ParseGithubIssueForAllRemotesLink()
        {
            GitExtLinkDef linkDef = GetGithubIssuesLinkDef();

            linkDef.UseRemotesPattern  = string.Empty;
            linkDef.UseOnlyFirstRemote = false;
            GitRevision revision = new GitRevision(null, "");

            revision.Body = "Merge pull request #3657 from RussKie/tweak_FormRemotes_tooltips";
            IGitRemoteController remoteController = Substitute.For <IGitRemoteController>();

            remoteController.Remotes.Returns(GetDefaultRemotes());
            IEnumerable <GitExtLink> actualLinks   = linkDef.Parse(revision, remoteController);
            IEnumerable <GitExtLink> expectedLinks = new GitExtLink[]
            {
                new GitExtLink()
                {
                    Caption = "Issue 3657",
                    URI     = "https://github.com/jbialobr/gitextensions/issues/3657"
                },
                new GitExtLink()
                {
                    Caption = "Issue 3657",
                    URI     = "https://github.com/gitextensions/gitextensions/issues/3657"
                },
                new GitExtLink()
                {
                    Caption = "Issue 3657",
                    URI     = "https://github.com/russkie/gitextensions/issues/3657"
                }
            };

            actualLinks.Should().Equal(expectedLinks);
        }
Esempio n. 2
0
        public void ParseLinkWithEmptyRemotePart()
        {
            GitExtLinkDef linkDef  = GitExtLinksParser.LoadFromXmlString(GetEmptyRemotePartXmlDef()).First();
            GitRevision   revision = new GitRevision(null, "");

            revision.Body = "Merge pull request #3657 from RussKie/tweak_FormRemotes_tooltips";
            IGitRemoteController remoteController = Substitute.For <IGitRemoteController>();

            remoteController.Remotes.Returns(GetDefaultRemotes());
            IEnumerable <GitExtLink> actualLinks   = linkDef.Parse(revision, remoteController);
            IEnumerable <GitExtLink> expectedLinks = new GitExtLink[]
            {
                new GitExtLink()
                {
                    Caption = "Issue 3657",
                    URI     = "https://github.com/gitextensions/gitextensions/issues/3657"
                }
            };

            actualLinks.Should().Equal(expectedLinks);
        }