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


C# EmptyRepositoryFixture.GetVersion方法代码示例

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


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

示例1: ShouldNotGetVersionFromFeatureBranchIfNotMerged

    public void ShouldNotGetVersionFromFeatureBranchIfNotMerged()
    {
        using (var fixture = new EmptyRepositoryFixture())
        {
            fixture.Repository.MakeATaggedCommit("1.0.0-unstable.0"); // initial commit in master

            fixture.Repository.CreateBranch("feature");
            fixture.Repository.Checkout("feature");
            fixture.Repository.MakeATaggedCommit("1.0.1-feature.1");

            fixture.Repository.Checkout("master");
            fixture.Repository.CreateBranch("develop");
            fixture.Repository.Checkout("develop");
            fixture.Repository.MakeACommit();

            var version = fixture.GetVersion();
            version.SemVer.ShouldBe("1.0.0-unstable.1");
        }
    }
开发者ID:qetza,项目名称:GitVersion,代码行数:19,代码来源:OtherBranchScenarios.cs

示例2: GitHubFlowMajorRelease

    public void GitHubFlowMajorRelease()
    {
        using (var fixture = new EmptyRepositoryFixture())
        {
            fixture.SequenceDiagram.Participant("master");

            fixture.Repository.MakeACommit();
            fixture.ApplyTag("1.3.0");

            // Create release branch
            fixture.BranchTo("release/2.0.0", "release");
            fixture.SequenceDiagram.Activate("release/2.0.0");
            fixture.MakeACommit();
            fixture.AssertFullSemver("2.0.0-beta.1+1");
            fixture.MakeACommit();
            fixture.AssertFullSemver("2.0.0-beta.1+2");

            // Apply beta.1 tag should be exact tag
            fixture.ApplyTag("2.0.0-beta.1");
            fixture.AssertFullSemver("2.0.0-beta.1");

            // test that the CommitsSinceVersionSource should still return commit count
            var version = fixture.GetVersion(new Config());
            version.CommitsSinceVersionSource.ShouldBe("2");

            // Make a commit after a tag should bump up the beta
            fixture.MakeACommit();
            fixture.AssertFullSemver("2.0.0-beta.2+3");

            // Complete release
            fixture.Checkout("master");
            fixture.MergeNoFF("release/2.0.0");
            fixture.SequenceDiagram.Destroy("release/2.0.0");
            fixture.SequenceDiagram.NoteOver("Release branches are deleted once merged", "release/2.0.0");

            fixture.AssertFullSemver("2.0.0+0");
            fixture.ApplyTag("2.0.0");
            fixture.AssertFullSemver("2.0.0");
            fixture.MakeACommit();
            fixture.Repository.DumpGraph();
            fixture.AssertFullSemver("2.0.1+1");
        }
    }
开发者ID:onovotny,项目名称:GitVersion,代码行数:43,代码来源:DocumentationSamples.cs


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