コード例 #1
0
        public string[] TestGetPrimaryParents(string path, string commitSha)
        {
            var repo   = GetTestRepo(path);
            var commit = repo.Lookup <Commit>(commitSha);

            return(RepoUtil.GetPrimaryParents(commit).Select(c => c.Sha).ToArray());
        }
コード例 #2
0
        public void TestGetMergesBySource(string path, Dictionary <string, HashSet <string> > expected)
        {
            var merges = RepoUtil.GetMergesBySource(GetTestRepo(path));

            Assert.That(merges.Keys.Select(c => c.Sha), Is.EquivalentTo(expected.Keys), "Merge sources do not match");
            foreach (Commit source in merges.Keys)
            {
                Assert.That(merges[source].Select(c => c.Sha), Is.EquivalentTo(expected[source.Sha]), $"Merge target does not match for source {source.Sha}");
            }
        }
コード例 #3
0
        public void TestGetAllCommits(string path, string[] expected)
        {
            var repo = GetTestRepo(path);

            Assert.That(RepoUtil.GetAllCommits(repo).Select(c => c.Sha).ToArray(), Is.EquivalentTo(expected));
        }