本文整理汇总了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");
}
}
示例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");
}
}