当前位置: 首页>>代码示例>>C#>>正文


C# EmptyRepositoryFixture.ExecuteGitVersion方法代码示例

本文整理汇总了C#中EmptyRepositoryFixture.ExecuteGitVersion方法的典型用法代码示例。如果您正苦于以下问题:C# EmptyRepositoryFixture.ExecuteGitVersion方法的具体用法?C# EmptyRepositoryFixture.ExecuteGitVersion怎么用?C# EmptyRepositoryFixture.ExecuteGitVersion使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在EmptyRepositoryFixture的用法示例。


在下文中一共展示了EmptyRepositoryFixture.ExecuteGitVersion方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: MinorReleaseExample

        public void MinorReleaseExample()
        {
            using (var fixture = new EmptyRepositoryFixture())
            {
                fixture.Repository.MakeATaggedCommit("1.2.0");

                // Branch to develop
                fixture.Repository.CreateBranch("develop").Checkout();
                fixture.ExecuteGitVersion().OutputVariables[VariableProvider.FullSemVer].ShouldBe("1.3.0.0-unstable");

                // Open Pull Request
                fixture.Repository.CreateBranch("pull/2/merge").Checkout();
                fixture.ExecuteGitVersion().OutputVariables[VariableProvider.FullSemVer].ShouldBe("1.3.0-PullRequest.2+0");
                fixture.Repository.MakeACommit();
                fixture.ExecuteGitVersion().OutputVariables[VariableProvider.FullSemVer].ShouldBe("1.3.0-PullRequest.2+1");

                // Merge into develop
                fixture.Repository.Checkout("develop");
                fixture.Repository.MergeNoFF("pull/2/merge", Constants.SignatureNow());
                fixture.ExecuteGitVersion().OutputVariables[VariableProvider.FullSemVer].ShouldBe("1.3.0.2-unstable");

                // Create release branch
                fixture.Repository.CreateBranch("release-1.3.0").Checkout();
                fixture.ExecuteGitVersion().OutputVariables[VariableProvider.FullSemVer].ShouldBe("1.3.0-beta.1+0");

                // Make another commit on develop
                fixture.Repository.Checkout("develop");
                fixture.Repository.MakeACommit();
                fixture.ExecuteGitVersion().OutputVariables[VariableProvider.FullSemVer].ShouldBe("1.3.0.3-unstable");

                // Make a commit to release-1.3.0
                fixture.Repository.Checkout("release-1.3.0");
                fixture.Repository.MakeACommit();
                fixture.ExecuteGitVersion().OutputVariables[VariableProvider.FullSemVer].ShouldBe("1.3.0-beta.1+1");

                // Apply beta.0 tag
                fixture.Repository.ApplyTag("1.3.0-beta.1");
                fixture.ExecuteGitVersion().OutputVariables[VariableProvider.FullSemVer].ShouldBe("1.3.0-beta.2+1");

                // Merge release branch to master
                fixture.Repository.Checkout("master");
                fixture.Repository.MergeNoFF("release-1.3.0", Constants.SignatureNow());
                fixture.ExecuteGitVersion().OutputVariables[VariableProvider.FullSemVer].ShouldBe("1.3.0");
                fixture.Repository.ApplyTag("1.3.0");

                // Verify develop version
                fixture.Repository.Checkout("develop");
                fixture.Repository.MergeNoFF("release-1.3.0", Constants.SignatureNow());
                fixture.ExecuteGitVersion().OutputVariables[VariableProvider.FullSemVer].ShouldBe("1.4.0.2-unstable");
            }
        }
开发者ID:potherca-contrib,项目名称:GitVersion,代码行数:51,代码来源:WikiScenarios.cs

示例2: WhenDevelopBranchedFromMaster_MinorIsIncreased

        public void WhenDevelopBranchedFromMaster_MinorIsIncreased()
        {
            using (var fixture = new EmptyRepositoryFixture())
            {
                fixture.Repository.MakeATaggedCommit("1.0.0");
                fixture.Repository.CreateBranch("develop").Checkout();

                var result = fixture.ExecuteGitVersion();

                result.OutputVariables[VariableProvider.SemVer].ShouldBe("1.1.0.0-unstable");
            }
        }
开发者ID:robdmoore,项目名称:GitVersion,代码行数:12,代码来源:DevelopScenarios.cs

示例3: GivenARepositoryWithTagAndNoNextVersionTxtFile_VersionShouldBeTagWithBumpedPatch

        public void GivenARepositoryWithTagAndNoNextVersionTxtFile_VersionShouldBeTagWithBumpedPatch()
        {
            using (var fixture = new EmptyRepositoryFixture())
            {
                const string TaggedVersion = "1.0.3";
                fixture.Repository.MakeATaggedCommit(TaggedVersion);
                fixture.Repository.MakeCommits(5);

                var result = fixture.ExecuteGitVersion();

                result.ExitCode.ShouldBe(0);
                result.OutputVariables[VariableProvider.FullSemVer].ShouldBe("1.0.4+5");
            }
        }
开发者ID:potherca-contrib,项目名称:GitVersion,代码行数:14,代码来源:MasterTests.cs

示例4: GivenARepositoryWithTagAndANextVersionTxtFileAndNoCommits_VersionShouldBeTag

        public void GivenARepositoryWithTagAndANextVersionTxtFileAndNoCommits_VersionShouldBeTag()
        {
            using (var fixture = new EmptyRepositoryFixture())
            {
                const string ExpectedNextVersion = "1.1.0";
                const string TaggedVersion = "1.0.3";
                fixture.Repository.MakeATaggedCommit(TaggedVersion);
                fixture.Repository.AddNextVersionTxtFile(ExpectedNextVersion);

                var result = fixture.ExecuteGitVersion();

                result.ExitCode.ShouldBe(0);
                result.OutputVariables[VariableProvider.FullSemVer].ShouldBe("1.0.3+0");
            }
        }
开发者ID:robdmoore,项目名称:GitVersion,代码行数:15,代码来源:MasterTests.cs

示例5: GivenARepositoryWithNoTagsAndANextVersionTxtFile_VersionShouldMatchVersionTxtFile

        public void GivenARepositoryWithNoTagsAndANextVersionTxtFile_VersionShouldMatchVersionTxtFile()
        {
            using (var fixture = new EmptyRepositoryFixture())
            {
                const string ExpectedNextVersion = "1.0.0";
                fixture.Repository.MakeACommit();
                fixture.Repository.MakeACommit();
                fixture.Repository.MakeACommit();
                fixture.Repository.AddNextVersionTxtFile(ExpectedNextVersion);

                var result = fixture.ExecuteGitVersion();

                result.ExitCode.ShouldBe(0);
                result.OutputVariables[VariableProvider.FullSemVer].ShouldBe("1.0.0+2");
            }
        }
开发者ID:potherca-contrib,项目名称:GitVersion,代码行数:16,代码来源:MasterTests.cs

示例6: GivenARepositoryWithCommitsButNoTags_VersionShouldBe_0_1

        public void GivenARepositoryWithCommitsButNoTags_VersionShouldBe_0_1()
        {
            using (var fixture = new EmptyRepositoryFixture())
            {
                // Given
                fixture.Repository.MakeACommit();
                fixture.Repository.MakeACommit();
                fixture.Repository.MakeACommit();

                // When
                var result = fixture.ExecuteGitVersion();

                result.ExitCode.ShouldBe(0);
                result.OutputVariables[VariableProvider.FullSemVer].ShouldBe("0.1.0+2");
            }
        }
开发者ID:potherca-contrib,项目名称:GitVersion,代码行数:16,代码来源:MasterTests.cs

示例7: CanTakeVersionFromReleaseBranch

        public void CanTakeVersionFromReleaseBranch()
        {
            using (var fixture = new EmptyRepositoryFixture())
            {
                const string TaggedVersion = "1.0.3";
                fixture.Repository.MakeATaggedCommit(TaggedVersion);
                fixture.Repository.MakeCommits(5);
                fixture.Repository.CreateBranch("release-2.0.0");
                fixture.Repository.Checkout("release-2.0.0");

                var result = fixture.ExecuteGitVersion();

                result.ExitCode.ShouldBe(0);
                result.OutputVariables[VariableProvider.FullSemVer].ShouldBe("2.0.0-beta.1+5");
            }
        }
开发者ID:potherca-contrib,项目名称:GitVersion,代码行数:16,代码来源:ReleaseBranchTests.cs

示例8: WhenReleaseBranchIsMergedIntoMasterVersionIsTakenWithIt

        public void WhenReleaseBranchIsMergedIntoMasterVersionIsTakenWithIt()
        {
            using (var fixture = new EmptyRepositoryFixture())
            {
                const string TaggedVersion = "1.0.3";
                fixture.Repository.MakeATaggedCommit(TaggedVersion);
                fixture.Repository.MakeCommits(1);
                fixture.Repository.CreateBranch("release-2.0.0");
                fixture.Repository.Checkout("release-2.0.0");
                fixture.Repository.MakeCommits(4);
                fixture.Repository.Checkout("master");
                fixture.Repository.MergeNoFF("release-2.0.0", Constants.SignatureNow());

                var result = fixture.ExecuteGitVersion();

                result.ExitCode.ShouldBe(0);
                result.OutputVariables[VariableProvider.FullSemVer].ShouldBe("2.0.0+6");
            }
        }
开发者ID:potherca-contrib,项目名称:GitVersion,代码行数:19,代码来源:ReleaseBranchTests.cs


注:本文中的EmptyRepositoryFixture.ExecuteGitVersion方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。