Exemple #1
0
        public void StandardIssueNumberWithAlphaNumericProjectIdentifierEnclosedInBracketsReferenceGetsParsedCorrectly(string comment, string expectedReference)
        {
            var workItemReferences = new CommentParser().ParseWorkItemIds(Create(comment));

            Assert.IsNotEmpty(workItemReferences);

            var reference = workItemReferences.First();

            Assert.AreEqual(expectedReference, reference);
        }
Exemple #2
0
        public void JiraIssueInBranchNameGetsParsedCorrectly(string comment, string expectedReference)
        {
            var workItemReferences = new CommentParser().ParseWorkItemIds(Create(comment));

            Assert.IsNotEmpty(workItemReferences);

            var reference = workItemReferences.First();

            Assert.AreEqual(expectedReference, reference);
        }
Exemple #3
0
        public void StandardIssueNumberWithAlphaNumericProjectIdentifierReferenceGetsParsedCorrectly()
        {
            var workItemReferences = new CommentParser().ParseWorkItemIds(Create("Fixes BT2-1234"));

            Assert.IsNotEmpty(workItemReferences);

            var reference = workItemReferences.First();

            Assert.AreEqual("BT2-1234", reference);
        }
Exemple #4
0
        public void StandardIssueNumberReferenceGetsParsedCorrectly()
        {
            var workItemReferences = new CommentParser().ParseWorkItemIds(Create("Fixes JRE-1234"));

            Assert.IsNotEmpty(workItemReferences);

            var reference = workItemReferences.First();

            Assert.AreEqual("JRE-1234", reference);
        }
        public void TheKeywordsAllWork(string keyword)
        {
            var workItemReferences = new CommentParser().ParseWorkItemReferences(Create($"{keyword} #1234"));

            Assert.IsNotEmpty(workItemReferences);

            var reference = workItemReferences.First();

            Assert.AreEqual("1234", reference.IssueNumber);
            Assert.AreEqual("#1234", reference.LinkData);
        }
        public void AbsoluteUrlReferenceGetsParsedCorrectly()
        {
            var workItemReferences = new CommentParser().ParseWorkItemReferences(Create("Fixes https://github.com/OrgA/RepoB/issues/1234"));

            Assert.IsNotEmpty(workItemReferences);

            var reference = workItemReferences.First();

            Assert.AreEqual("1234", reference.IssueNumber);
            Assert.AreEqual("https://github.com/OrgA/RepoB/issues/1234", reference.LinkData);
        }
        public void GHReferenceGetsParsedCorrectly()
        {
            var workItemReferences = new CommentParser().ParseWorkItemReferences(Create("Fixes GH-1234"));

            Assert.IsNotEmpty(workItemReferences);

            var reference = workItemReferences.First();

            Assert.AreEqual("1234", reference.IssueNumber);
            Assert.AreEqual("GH-1234", reference.LinkData);
        }
        public void IssueReferenceToAnotherRepoWithDashGetsParsedCorrectly()
        {
            var workItemReferences = new CommentParser().ParseWorkItemReferences(Create("Fixes OrgA/Repo-B#1234"));

            Assert.IsNotEmpty(workItemReferences);

            var reference = workItemReferences.First();

            Assert.AreEqual("1234", reference.IssueNumber);
            Assert.AreEqual("OrgA/Repo-B#1234", reference.LinkData);
        }
Exemple #9
0
        public void MultipleIssueNumberReferencesEnclosedInBracketsGetsParsedCorrectly(string comment, params string[] expectedReferences)
        {
            var workItemReferences = new CommentParser().ParseWorkItemIds(Create(comment));

            Assert.IsNotEmpty(workItemReferences);
            Assert.AreEqual(2, workItemReferences.Length);

            var reference = workItemReferences.First();

            Assert.AreEqual(expectedReferences[0], reference);
            reference = workItemReferences.Last();
            Assert.AreEqual(expectedReferences[1], reference);
        }
Exemple #10
0
        public void MultipleIssueNumberReferencesGetsParsedCorrectly()
        {
            var workItemReferences = new CommentParser().ParseWorkItemIds(Create("Fixes JRE-1234,JRE-2345"));

            Assert.IsNotEmpty(workItemReferences);
            Assert.AreEqual(2, workItemReferences.Length);

            var reference = workItemReferences.First();

            Assert.AreEqual("JRE-1234", reference);
            reference = workItemReferences.Last();
            Assert.AreEqual("JRE-2345", reference);
        }
Exemple #11
0
        public void MultipleIssueNumberWithAlphaNumericProjectIdentifierEnclosedInBracketsReferencesGetsParsedCorrectly(string comment, params string[] expectedReferences)
        {
            var workItemReferences = new CommentParser().ParseWorkItemIds(Create("Fixes Bt2-1234,Bt2-2345"));

            Assert.IsNotEmpty(workItemReferences);
            Assert.AreEqual(2, workItemReferences.Length);

            var reference = workItemReferences.First();

            Assert.AreEqual(expectedReferences[0], reference);
            reference = workItemReferences.Last();
            Assert.AreEqual(expectedReferences[1], reference);
        }
Exemple #12
0
        public void MultipleIssueNumberWithAlphaNumericProjectIdentifierReferencesGetsParsedCorrectly()
        {
            var workItemReferences = new CommentParser().ParseWorkItemIds(Create("Fixes Bt2-1234,Bt2-2345"));

            Assert.IsNotEmpty(workItemReferences);
            Assert.AreEqual(2, workItemReferences.Length);

            var reference = workItemReferences.First();

            Assert.AreEqual("Bt2-1234", reference);
            reference = workItemReferences.Last();
            Assert.AreEqual("Bt2-2345", reference);
        }