public ChangeHistoryDataSet GetHistory(string[] taskTags)
        {
            ChangeHistoryDataSet history = new ChangeHistoryDataSet();

            foreach (Change change in GetChanges())
            {
                if (HistoryQueryHelper.IsChangeRelatedToTask(change.Comment, taskTags))
                {
                    System.Diagnostics.Trace.WriteLine(change.Version.ToString() + " - " + change.ElementId);
                    history.Add(
                        change.ElementId,
                        change.RepositoryPath,
                        change.Version,
                        -1,
                        change.Date,
                        change.User,
                        change.Comment);
                }
            }
            return(history);
        }
Exemple #2
0
 public void ShouldMatchCommentsWithTagsAtTheEnd()
 {
     Assert.IsTrue(HistoryQueryHelper.IsChangeRelatedToTask("blah [53]", "53"));
 }
Exemple #3
0
 public void ShouldMatchCommentsWithMultipleBracketings()
 {
     Assert.IsTrue(HistoryQueryHelper.IsChangeRelatedToTask("[53] [64] blah", "64"));
 }
Exemple #4
0
 public void ShouldMatchCommentsWithOneMatchingIdInListOfChoices()
 {
     Assert.IsTrue(HistoryQueryHelper.IsChangeRelatedToTask("[64] blah", "53", "64"));
 }
Exemple #5
0
 public void ShouldMatchCommentsWithOneMatchingIdInCommentThatHasSpaces()
 {
     Assert.IsTrue(HistoryQueryHelper.IsChangeRelatedToTask("[64, 53] blah", "53"));
 }
Exemple #6
0
 public void ShouldMatchCommentsWithLettersInTaskIdIgnoringCase()
 {
     Assert.IsTrue(HistoryQueryHelper.IsChangeRelatedToTask("[T53] blah", "t53"));
     Assert.IsTrue(HistoryQueryHelper.IsChangeRelatedToTask("[t53] blah", "T53"));
 }
Exemple #7
0
 public void ShouldMatchCommentsWithTheSameId()
 {
     Assert.IsTrue(HistoryQueryHelper.IsChangeRelatedToTask("[53] blah", "53"));
 }
Exemple #8
0
 public void ShouldNotMatchCommentsWithDifferentIds()
 {
     Assert.IsFalse(HistoryQueryHelper.IsChangeRelatedToTask("[64] blah", "53"));
 }
Exemple #9
0
 public void ShouldNotMatchCommentsThatDoNotUseBrackets()
 {
     Assert.IsFalse(HistoryQueryHelper.IsChangeRelatedToTask("53 comments", "53"));
 }
Exemple #10
0
 public void ShouldNotMatchCommentsWithNoTags()
 {
     Assert.IsFalse(HistoryQueryHelper.IsChangeRelatedToTask("Comment with no tags", "53"));
 }