public void CommitFinder_EndingOnlyRange_ReturnsCorrectEntires() { var range = new SearchRange(); range.Newest = "261dab6".Some(); var commits = CommitFinder.Parse(TestDataLocator.GetPath(), range); Assert.AreEqual(20, commits.Count()); }
public void CommitFinder_ParseInvalidBranch_ReturnsEmpty() { var commits = CommitFinder.Parse(TestDataLocator.GetPath(), new SearchRange() { Oldest = "a-non-existant-branch".Some() }); Assert.Zero(commits.Count()); }
public void CommitParser_SmokeTestAllCommits() { var commits = CommitFinder.Parse(TestDataLocator.GetPath(), new SearchRange()); var parsedCommits = CommitParser.Parse(commits, new SearchOptions()); Assert.NotZero(commits.Count()); foreach (var parsedCommit in parsedCommits) { Assert.IsNotNull(parsedCommit.Commit.Title); Assert.IsNotNull(parsedCommit.Link); } }
public void CommitFinder_Parse_ReturnsEntries() { var commits = CommitFinder.Parse(TestDataLocator.GetPath(), new SearchRange()); int count = commits.Count(); Assert.NotZero(commits.Count()); foreach (var commit in commits) { Assert.IsNotNull(commit.Hash); Assert.IsNotNull(commit.Title); Assert.IsNotNull(commit.Description); } }
public void CommitFinder_StartingOnlyRange_ReturnsCorrectEntires() { // This is brittle if we add more tests data var range = new SearchRange(); range.Oldest = "261dab6".Some(); var commits = CommitFinder.Parse(TestDataLocator.GetPath(), range); Assert.AreEqual(27, commits.Count()); range.IncludeOldest = false; commits = CommitFinder.Parse(TestDataLocator.GetPath(), range); Assert.AreEqual(26, commits.Count()); }
public void CommitFinder_SubsetRange_ReturnsCorrectEntires() { var range = new SearchRange(); range.Oldest = "4bb85fb".Some(); range.Newest = "261dab6".Some(); var commits = CommitFinder.Parse(TestDataLocator.GetPath(), range); Assert.AreEqual(6, commits.Count()); range.IncludeOldest = false; commits = CommitFinder.Parse(TestDataLocator.GetPath(), range); Assert.AreEqual(5, commits.Count()); }
public void BugCollector_SmokeTest() { var options = new SearchOptions() { Bugzilla = BugzillaLevel.Private }; var range = new SearchRange { Oldest = "98fff31".Some(), Newest = "6c280ad".Some() }; var commits = CommitFinder.Parse(TestDataLocator.GetPath(), range); var parsedCommits = CommitParser.Parse(commits, options).ToList(); var bugCollection = BugCollector.ClassifyCommits(parsedCommits, options); Assert.AreEqual(2, bugCollection.Bugs.Count); Assert.AreEqual(3, bugCollection.PotentialBugs.Count); }
public void BugCollector_HandlesDuplicateBugEntries() { // One commit with certain, one without. Only one copy in final output var options = new SearchOptions() { Bugzilla = BugzillaLevel.Private }; var range = new SearchRange { Oldest = "ad26139".Some(), Newest = "6c280ad".Some() }; var commits = CommitFinder.Parse(TestDataLocator.GetPath(), range); var parsedCommits = CommitParser.Parse(commits, options).ToList(); var bugCollection = BugCollector.ClassifyCommits(parsedCommits, new SearchOptions()); Assert.AreEqual(1, bugCollection.Bugs.Count); Assert.AreEqual(0, bugCollection.PotentialBugs.Count); }
public void CommitFinder_ParseInvalidPath_ReturnsEmpty() { var commits = CommitFinder.Parse("/not/a/path", new SearchRange()); Assert.Zero(commits.Count()); }