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); }
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); }
public void StandardIssueNumberWithAlphaNumericProjectIdentifierReferenceGetsParsedCorrectly() { var workItemReferences = new CommentParser().ParseWorkItemIds(Create("Fixes BT2-1234")); Assert.IsNotEmpty(workItemReferences); var reference = workItemReferences.First(); Assert.AreEqual("BT2-1234", reference); }
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); }
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); }
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); }
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); }
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); }