Skip to content

Commit

Permalink
New unit test that repoduces GitTools#2034 issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikolay Dzencharskiy authored and Nikolay Dzencharskiy committed Jan 21, 2020
1 parent d84c116 commit 14edecc
Showing 1 changed file with 44 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,50 @@ public void MergingFeatureBranchThatIncrementsMinorNumberIncrementsMinorVersionO
fixture.AssertFullSemver(currentConfig, "1.1.0");
}

[Test]
public void MergingMasterBarnchToDevelopWithInheritIncrementShouldIncrementDevelopPatch()
{
var currentConfig = new Config
{
AssemblyVersioningScheme = AssemblyVersioningScheme.MajorMinorPatch,
VersioningMode = VersioningMode.Mainline,
Branches = new Dictionary<string, BranchConfig>
{
{
"master", new BranchConfig
{
Increment = IncrementStrategy.Patch
}
},
{
"develop", new BranchConfig
{
Increment = IncrementStrategy.Inherit
}
}
}
};

using var fixture = new EmptyRepositoryFixture();
fixture.MakeACommit("initial in master");
fixture.AssertFullSemver(currentConfig, "0.1.0");
fixture.MakeACommit("master change");
fixture.AssertFullSemver(currentConfig, "0.1.1");

fixture.BranchTo("develop");
fixture.AssertFullSemver(currentConfig, "0.1.2-alpha.0");
fixture.MakeACommit("develop change");
fixture.AssertFullSemver(currentConfig, "0.1.2-alpha.1");

fixture.Checkout("master");
fixture.MakeACommit("master hotfix");
fixture.AssertFullSemver(currentConfig, "0.1.2");

fixture.Checkout("develop");
fixture.MergeNoFF("master");
fixture.AssertFullSemver(currentConfig, "0.1.3-alpha.1");
}

[Test]
public void VerifyIncrementConfigIsHonoured()
{
Expand Down

0 comments on commit 14edecc

Please sign in to comment.