Exemple #1
0
        public void FeatureDebugMergedVersion()
        {
            var repoReader = new GitRepoReader(TestRepositories.FeatureDebugMergedRepository(), string.Empty);

            repoReader.CommitCountDevelopSinceLastMinorCoreVersion.Should().Be(4);
            repoReader.CommitCountUniqueToFeature.Should().Be(7);
        }
Exemple #2
0
        public void RepoWithoutHeadNoBranchTest()
        {
            Action action = () =>
            {
                _ = GenerateVersionNumber(TestRepositories.DeteachedHeadRepo());
            };

            action.Should().Throw <InvalidOperationException>();
        }
Exemple #3
0
        public void RepoWithoutHeadIncorrectBranchTest()
        {
            Action action = () =>
            {
                _ = GenerateVersionNumber(TestRepositories.DeteachedHeadRepo(), "feature/a");
            };

            action.Should().Throw <ArgumentException>();
        }
Exemple #4
0
        public void MasterPastDevelopTest()
        {
            var repoReader = new GitRepoReader(TestRepositories.MasterAheadOfDevelopRepository(), string.Empty);

            repoReader.CurrentBranch.Name.Should().Be(DashDashVersion.Constants.DevelopBranchName);
            repoReader.CommitCountDevelopSinceLastMinorCoreVersion.Should().Be(1);
            repoReader.HeadCommitHash.Should().Be("b");
            repoReader.CurrentCoreVersion.SemVer.Should().Be("0.0.0");
        }
Exemple #5
0
        public void RepoWithoutHeadIncorrectPartialBranchNameTest()
        {
            Action action = () =>
            {
                _ = GenerateVersionNumber(TestRepositories.DeteachedHeadRepo(), "evelop");
            };

            action.Should().Throw <ArgumentException>();
        }
Exemple #6
0
        public void FeatureRepoTest()
        {
            var repoReader = new GitRepoReader(TestRepositories.FeatureBranchOnFeatureBranchRepository(), string.Empty);

            repoReader.CommitCountUniqueToFeature.Should().Be(2);
            repoReader.CommitCountDevelopSinceLastMinorCoreVersion.Should().Be(1);
            repoReader.HeadCommitHash.Should().Be("d");
            repoReader.CurrentCoreVersion.SemVer.Should().Be("0.0.0");
            repoReader.CurrentBranch.Name.Should().Be($"{DashDashVersion.Constants.FeatureBranchName}/B");
        }
Exemple #7
0
        public void RemoteDevelopRepoTest()
        {
            var repoReader = new GitRepoReader(TestRepositories.RemoteDevelopRepository(), string.Empty);

            repoReader.CommitCountUniqueToFeature.Should().Be(0);
            repoReader.CommitCountDevelopSinceLastMinorCoreVersion.Should().Be(1);
            repoReader.CurrentBranch.Name.Should().Be(DashDashVersion.Constants.DevelopBranchName);
            repoReader.CurrentCoreVersion.SemVer.Should().Be("0.0.0");
            repoReader.HeadCommitHash.Should().Be("b");
        }
Exemple #8
0
        public void ReleaseRepoWithTagTest()
        {
            var repoReader = new GitRepoReader(TestRepositories.ReleaseBranchRepositoryWithTaggedRc(), string.Empty);

            repoReader.CommitCountUniqueToFeature.Should().Be(3);
            repoReader.CommitCountDevelopSinceLastMinorCoreVersion.Should().Be(1);
            repoReader.HeadCommitHash.Should().Be("e");
            repoReader.CurrentCoreVersion.SemVer.Should().Be("0.0.0");
            repoReader.CurrentBranch.Name.Should().Be($"{DashDashVersion.Constants.ReleaseBranchName}/1.0.0");
            repoReader.HighestMatchingTagForReleaseCandidate?.ToString().Should().Be("1.0.0-rc.2");
        }
        public void ServiceRepositoryTest()
        {
            var version = GenerateVersionNumber(TestRepositories.ServiceRepository());

            version.SemVer.Should().Be("1.5.0");
        }
Exemple #10
0
        public void DevelopRepoVersionTest()
        {
            var version = GenerateVersionNumber(TestRepositories.TwoCommitsOnDevelopRepository());

            version.SemVer.Should().Be("0.1.0-dev.1");
        }
Exemple #11
0
        public void MasterRepoVersionTest()
        {
            var version = GenerateVersionNumber(TestRepositories.MasterRepository());

            version.SemVer.Should().Be("1.0.0");
        }
Exemple #12
0
        public void FeatureRepoVersionTest()
        {
            var version = GenerateVersionNumber(TestRepositories.FeatureBranchOnFeatureBranchRepository());

            version.SemVer.Should().Be("0.1.0-dev.1.B.2");
        }
Exemple #13
0
        public void PatchReleaseTest()
        {
            var version = GenerateVersionNumber(TestRepositories.PatchReleaseRepository());

            version.SemVer.Should().Be("0.2.0-dev.3");
        }
Exemple #14
0
        public void ReleaseRepoWithTagVersionTest()
        {
            var version = GenerateVersionNumber(TestRepositories.ReleaseBranchRepositoryWithTaggedRc());

            version.SemVer.Should().Be("1.0.0-rc.3");
        }
        public void RemoteBugfixRepositoryTest()
        {
            var version = GenerateVersionNumber(TestRepositories.RemoteBugfixRepository(), "bugfix/test");

            version.SemVer.Should().Be("0.1.0-dev.1.test.1");
        }
Exemple #16
0
        public void RepoWithoutHeadFullRemotePathTest()
        {
            var version = GenerateVersionNumber(TestRepositories.DeteachedHeadRepo(), "A");

            version.SemVer.Should().Be("0.2.0-dev.0.FeatureA.0");
        }
Exemple #17
0
        public void RepoWithoutHeadMasterTest()
        {
            var version = GenerateVersionNumber(TestRepositories.DeteachedHeadRepo(), "master");

            version.SemVer.Should().Be("0.1.0");
        }
Exemple #18
0
        public void RepoWithoutHeadDevelopTest()
        {
            var version = GenerateVersionNumber(TestRepositories.DeteachedHeadRepo(), "develop");

            version.SemVer.Should().Be("0.2.0-dev.0");
        }