@@ -410,32 +410,23 @@ public void TrackMergeMessageShouldBeConsideredOnTheMainBranch(bool trackMergeMe
410410 [ Test ]
411411 public void ShouldProvideTheCorrectVersionEvenIfPreReleaseLabelExistsInTheGitTag ( )
412412 {
413- var config = new Config
414- {
415- NextVersion = "5.0" ,
416- Branches =
417- {
418- {
419- "master" , new BranchConfig
420- {
421- Regex = "master" ,
422- Tag = "beta" ,
423- Increment = IncrementStrategy . Patch ,
424- VersioningMode = VersioningMode . ContinuousDeployment
425- }
426- }
427- }
428- } ;
429- using ( var fixture = new EmptyRepositoryFixture ( ) )
430- {
431- fixture . Repository . MakeACommit ( ) ;
432- fixture . AssertFullSemver ( config , "5.0.0-beta.0" ) ; // why not "5.0.0-beta.1"?
433- fixture . Repository . MakeACommit ( ) ;
434- fixture . AssertFullSemver ( config , "5.0.0-beta.1" ) ;
435- fixture . Repository . MakeATaggedCommit ( "v5.0.0-rc.1" ) ;
436- fixture . AssertFullSemver ( config , "5.0.0-rc.1" ) ;
437- fixture . Repository . MakeACommit ( ) ;
438- fixture . AssertFullSemver ( config , "5.0.1-beta.1" ) ; // test fails here, it generates "5.0.0-beta.1" which is not unique and lower than "5.0.0-rc.1"
439- }
413+ var configuration = GitFlowConfigurationBuilder . New
414+ . WithSemanticVersionFormat ( SemanticVersionFormat . Loose )
415+ . WithNextVersion ( "5.0" )
416+ . WithBranch ( "main" ,
417+ branchBuilder => branchBuilder . WithLabel ( "beta" )
418+ . WithIncrement ( IncrementStrategy . Patch )
419+ . WithVersioningMode ( VersioningMode . ContinuousDeployment ) )
420+ . Build ( ) ;
421+
422+ using EmptyRepositoryFixture fixture = new ( "main" ) ;
423+ fixture . Repository . MakeACommit ( ) ;
424+ fixture . AssertFullSemver ( "5.0.0-beta.0" , configuration ) ; // why not "5.0.0-beta.1"?
425+ fixture . Repository . MakeACommit ( ) ;
426+ fixture . AssertFullSemver ( "5.0.0-beta.1" , configuration ) ;
427+ fixture . Repository . MakeATaggedCommit ( "v5.0.0-rc.1" ) ;
428+ fixture . AssertFullSemver ( "5.0.0-rc.1" , configuration ) ;
429+ fixture . Repository . MakeACommit ( ) ;
430+ fixture . AssertFullSemver ( "5.0.1-beta.1" , configuration ) ; // test fails here, it generates "5.0.0-beta.1" which is not unique and lower than "5.0.0-rc.1"
440431 }
441432}
0 commit comments