public void SupportCommitsWithMoreThanOneTag()
        {
            var commit1        = CreateCommit();
            var commit2        = CreateCommit();
            var commit3        = CreateCommit();
            var startTagCommit = CreateCommit();
            var firstCommit    = CreateCommit();

            SubstituteCommitLog(commit1, commit2, commit3, startTagCommit, firstCommit);
            _tags.Add(Tuple.Create(commit2, "1.1.0"));
            _tags.Add(Tuple.Create(commit2, "second_tag_for_commit2"));

            var results = ReleaseFinder.FindReleases(_repository, null, new ReleaseInfo());
        }
예제 #2
0
        public void DoesNotIncludeCommitsOlderThanTag()
        {
            var commit1        = CreateCommit();
            var startTagCommit = CreateCommit();
            var commit3        = CreateCommit();

            SubstituteCommitLog(commit1, startTagCommit, commit3);
            var startTag = new TaggedCommit(startTagCommit, "1.0.0");

            var results = ReleaseFinder.FindReleases(repository, startTag, new ReleaseInfo
            {
                PreviousReleaseDate = startTagCommit.Author.When
            });

            var firstRelease = results.First();

            firstRelease.PreviousReleaseDate.ShouldBe(startTagCommit.Author.When);
        }
예제 #3
0
        public void GroupsTagsByReleases()
        {
            var commit1        = CreateCommit();
            var commit2        = CreateCommit();
            var commit3        = CreateCommit();
            var startTagCommit = CreateCommit();

            SubstituteCommitLog(commit1, commit2, commit3, startTagCommit);
            tags.Add(commit2, "1.1.0");
            var startTag = new TaggedCommit(startTagCommit, "1.0.0");

            var results = ReleaseFinder.FindReleases(repository, startTag, new ReleaseInfo());

            results.Count.ShouldBe(2);
            results.ElementAt(0).Name.ShouldBe(null);
            results.ElementAt(0).PreviousReleaseDate.ShouldBe(commit2.Author.When);
            results.ElementAt(1).Name.ShouldBe("1.1.0");
            results.ElementAt(1).PreviousReleaseDate.ShouldBe(null);
        }
        public void GroupsTagsByReleasesIncludesEndDateOfRelease()
        {
            var commit1        = CreateCommit();
            var commit2        = CreateCommit();
            var commit3        = CreateCommit();
            var startTagCommit = CreateCommit();
            var firstCommit    = CreateCommit();

            SubstituteCommitLog(commit1, commit2, commit3, startTagCommit, firstCommit);
            _tags.Add(commit2, "1.1.0");
            _tags.Add(startTagCommit, "1.0.0");

            var results = ReleaseFinder.FindReleases(_repository, null, new ReleaseInfo());

            Assert.Equal(3, results.Count);
            Assert.Equal(null, results.ElementAt(0).Name);
            Assert.Equal(null, results.ElementAt(0).When);
            Assert.Equal(commit2.Author.When, results.ElementAt(0).PreviousReleaseDate);
            Assert.Equal(commit2.Author.When, results.ElementAt(1).When);
            Assert.Equal(startTagCommit.Author.When, results.ElementAt(1).PreviousReleaseDate);
            Assert.Equal("1.0.0", results.ElementAt(2).Name);
            Assert.Equal(startTagCommit.Author.When, results.ElementAt(2).When);
            Assert.Equal(null, results.ElementAt(2).PreviousReleaseDate);
        }