@@ -8,22 +8,22 @@ namespace GitVersion.Core.TrunkBased;
88internal partial class TrunkBasedScenariosWithAGitFlow
99{
1010 [ Parallelizable ( ParallelScope . All ) ]
11- public class GivenADevelopBranchWithOneCommitMergedToMainWithTrackMergeTargetWhenMergedCommitTaggedAsStable
11+ public class GivenADevelopBranchWithOneCommitMergedToMainWhenMergedCommitTaggedAsStable
1212 {
1313 private EmptyRepositoryFixture ? fixture ;
1414
1515 private static GitFlowConfigurationBuilder TrunkBasedBuilder => GitFlowConfigurationBuilder . New . WithLabel ( null )
1616 . WithVersioningMode ( VersioningMode . TrunkBased )
1717 . WithBranch ( "main" , _ => _ . WithVersioningMode ( VersioningMode . ManualDeployment ) )
18- . WithBranch ( "develop" , _ => _ . WithVersioningMode ( VersioningMode . ManualDeployment ) . WithTrackMergeTarget ( true ) ) ;
18+ . WithBranch ( "develop" , _ => _ . WithVersioningMode ( VersioningMode . ManualDeployment ) ) ;
1919
2020 [ OneTimeSetUp ]
2121 public void OneTimeSetUp ( )
2222 {
2323 // * 55 minutes ago (tag: 1.0.0, main)
2424 // |\
2525 // | * 56 minutes ago (HEAD -> develop)
26- // |/
26+ // |/
2727 // * 58 minutes ago
2828
2929 fixture = new EmptyRepositoryFixture ( "main" ) ;
@@ -58,11 +58,40 @@ public void OneTimeSetUp()
5858 [ TestCase ( IncrementStrategy . Major , IncrementStrategy . Patch , ExpectedResult = "1.0.1-alpha.1+0" ) ]
5959 [ TestCase ( IncrementStrategy . Major , IncrementStrategy . Minor , ExpectedResult = "1.1.0-alpha.1+0" ) ]
6060 [ TestCase ( IncrementStrategy . Major , IncrementStrategy . Major , ExpectedResult = "2.0.0-alpha.1+0" ) ]
61- public string GetVersion ( IncrementStrategy incrementOnMain , IncrementStrategy increment )
61+ public string GetVersionWithTrackMergeTargetOnDevelop ( IncrementStrategy incrementOnMain , IncrementStrategy increment )
6262 {
6363 IGitVersionConfiguration trunkBased = TrunkBasedBuilder
6464 . WithBranch ( "main" , _ => _ . WithIncrement ( incrementOnMain ) . WithLabel ( null ) )
65- . WithBranch ( "develop" , _ => _ . WithIncrement ( increment ) )
65+ . WithBranch ( "develop" , _ => _ . WithIncrement ( increment ) . WithTrackMergeTarget ( true ) )
66+ . Build ( ) ;
67+
68+ return fixture ! . GetVersion ( trunkBased ) . FullSemVer ;
69+ }
70+
71+ [ TestCase ( IncrementStrategy . None , IncrementStrategy . None , ExpectedResult = "0.0.0-alpha.1+2" ) ]
72+ [ TestCase ( IncrementStrategy . None , IncrementStrategy . Patch , ExpectedResult = "0.0.1-alpha.1+2" ) ]
73+ [ TestCase ( IncrementStrategy . None , IncrementStrategy . Minor , ExpectedResult = "0.1.0-alpha.1+2" ) ]
74+ [ TestCase ( IncrementStrategy . None , IncrementStrategy . Major , ExpectedResult = "1.0.0-alpha.1+2" ) ]
75+
76+ [ TestCase ( IncrementStrategy . Patch , IncrementStrategy . None , ExpectedResult = "0.0.0-alpha.1+2" ) ]
77+ [ TestCase ( IncrementStrategy . Patch , IncrementStrategy . Patch , ExpectedResult = "0.0.1-alpha.1+2" ) ]
78+ [ TestCase ( IncrementStrategy . Patch , IncrementStrategy . Minor , ExpectedResult = "0.1.0-alpha.1+2" ) ]
79+ [ TestCase ( IncrementStrategy . Patch , IncrementStrategy . Major , ExpectedResult = "1.0.0-alpha.1+2" ) ]
80+
81+ [ TestCase ( IncrementStrategy . Minor , IncrementStrategy . None , ExpectedResult = "0.0.0-alpha.1+2" ) ]
82+ [ TestCase ( IncrementStrategy . Minor , IncrementStrategy . Patch , ExpectedResult = "0.0.1-alpha.1+2" ) ]
83+ [ TestCase ( IncrementStrategy . Minor , IncrementStrategy . Minor , ExpectedResult = "0.1.0-alpha.1+2" ) ]
84+ [ TestCase ( IncrementStrategy . Minor , IncrementStrategy . Major , ExpectedResult = "1.0.0-alpha.1+2" ) ]
85+
86+ [ TestCase ( IncrementStrategy . Major , IncrementStrategy . None , ExpectedResult = "0.0.0-alpha.1+2" ) ]
87+ [ TestCase ( IncrementStrategy . Major , IncrementStrategy . Patch , ExpectedResult = "0.0.1-alpha.1+2" ) ]
88+ [ TestCase ( IncrementStrategy . Major , IncrementStrategy . Minor , ExpectedResult = "0.1.0-alpha.1+2" ) ]
89+ [ TestCase ( IncrementStrategy . Major , IncrementStrategy . Major , ExpectedResult = "1.0.0-alpha.1+2" ) ]
90+ public string GetVersionWithNoTrackMergeTargetOnDevelop ( IncrementStrategy incrementOnMain , IncrementStrategy increment )
91+ {
92+ IGitVersionConfiguration trunkBased = TrunkBasedBuilder
93+ . WithBranch ( "main" , _ => _ . WithIncrement ( incrementOnMain ) . WithLabel ( null ) )
94+ . WithBranch ( "develop" , _ => _ . WithIncrement ( increment ) . WithTrackMergeTarget ( false ) )
6695 . Build ( ) ;
6796
6897 return fixture ! . GetVersion ( trunkBased ) . FullSemVer ;
0 commit comments